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 2b7bd36..2882bc7 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);