]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerPaolo Pisati <paolo.pisati@canonical.com>
Wed, 23 Mar 2022 10:51:20 +0000 (11:51 +0100)
BugLink: https://bugs.launchpad.net/bugs/1966057
[ Upstream commit dd3b1dc3dd050f1f47cd13e300732852414270f8 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
net/bluetooth/hci_core.c

index 53f1b08017aab97ae3b23e31f9d0e445470687b0..c67390367cc2cbec7de9ff9949f05ef075e82367 100644 (file)
@@ -4083,6 +4083,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);