diff mbox series

Bluetooth: hci_core: Fix leaking sent_cmd skb

Message ID 20220204211236.2690926-1-luiz.dentz@gmail.com
State New
Headers show
Series Bluetooth: hci_core: Fix leaking sent_cmd skb | expand

Commit Message

Luiz Augusto von Dentz Feb. 4, 2022, 9:12 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

sent_cmd memory is not freed before freeing hci_dev causing it to leak
it contents.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
 net/bluetooth/hci_core.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Marcel Holtmann Feb. 7, 2022, 3:55 p.m. UTC | #1
Hi Luiz,

> sent_cmd memory is not freed before freeing hci_dev causing it to leak
> it contents.
> 
> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> ---
> net/bluetooth/hci_core.c | 1 +
> 1 file changed, 1 insertion(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel
diff mbox series

Patch

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 5bde0ec41177..b4782a6c1025 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2739,6 +2739,7 @@  void hci_release_dev(struct hci_dev *hdev)
 	hci_dev_unlock(hdev);
 
 	ida_simple_remove(&hci_index_ida, hdev->id);
+	kfree_skb(hdev->sent_cmd);
 	kfree(hdev);
 }
 EXPORT_SYMBOL(hci_release_dev);