]> git.baikalelectronics.ru Git - kernel.git/commitdiff
Bluetooth: hci_core: Fix leaking sent_cmd skb
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 4 Feb 2022 21:12:35 +0000 (13:12 -0800)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 24 Feb 2022 20:05:21 +0000 (21:05 +0100)
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>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/hci_core.c

index 2b7bd3655b076634773fa08065071101c2273819..2882bc7d79d79d6725e7432b8d3787d11e7b099d 100644 (file)
@@ -2738,6 +2738,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);