* [PATCH] Bluetooth: drop HCI device reference before return
@ 2021-01-21 7:34 Pan Bian
2021-01-25 15:14 ` Marcel Holtmann
0 siblings, 1 reply; 2+ messages in thread
From: Pan Bian @ 2021-01-21 7:34 UTC (permalink / raw)
To: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz,
David S. Miller, Jakub Kicinski, Gustavo Padovan,
Andrei Emeltchenko
Cc: linux-bluetooth, netdev, linux-kernel, Pan Bian
Call hci_dev_put() to decrement reference count of HCI device hdev if
fails to duplicate memory.
Fixes: 0b26ab9dce74 ("Bluetooth: AMP: Handle Accept phylink command status evt")
Signed-off-by: Pan Bian <bianpan2016@163.com>
---
net/bluetooth/a2mp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c
index da7fd7c8c2dc..5974fd828c35 100644
--- a/net/bluetooth/a2mp.c
+++ b/net/bluetooth/a2mp.c
@@ -512,6 +512,7 @@ static int a2mp_createphyslink_req(struct amp_mgr *mgr, struct sk_buff *skb,
assoc = kmemdup(req->amp_assoc, assoc_len, GFP_KERNEL);
if (!assoc) {
amp_ctrl_put(ctrl);
+ hci_dev_put(hdev);
return -ENOMEM;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Bluetooth: drop HCI device reference before return
2021-01-21 7:34 [PATCH] Bluetooth: drop HCI device reference before return Pan Bian
@ 2021-01-25 15:14 ` Marcel Holtmann
0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2021-01-25 15:14 UTC (permalink / raw)
To: Pan Bian
Cc: Johan Hedberg, Luiz Augusto von Dentz, David S. Miller,
Jakub Kicinski, Gustavo Padovan, Andrei Emeltchenko,
Bluetooth Kernel Mailing List, netdev, linux-kernel
Hi Pan,
> Call hci_dev_put() to decrement reference count of HCI device hdev if
> fails to duplicate memory.
>
> Fixes: 0b26ab9dce74 ("Bluetooth: AMP: Handle Accept phylink command status evt")
> Signed-off-by: Pan Bian <bianpan2016@163.com>
> ---
> net/bluetooth/a2mp.c | 1 +
> 1 file changed, 1 insertion(+)
patch has been applied to bluetooth-next tree.
Regards
Marcel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-01-25 15:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-21 7:34 [PATCH] Bluetooth: drop HCI device reference before return Pan Bian
2021-01-25 15:14 ` Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).