lkml.org 
[lkml]   [2022]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.16 15/28] Bluetooth: hci_core: Fix leaking sent_cmd skb
    Date
    From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

    [ 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>
    ---
    net/bluetooth/hci_core.c | 1 +
    1 file changed, 1 insertion(+)

    diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
    index 6c00ce302f09..1c8fb27b155a 100644
    --- a/net/bluetooth/hci_core.c
    +++ b/net/bluetooth/hci_core.c
    @@ -3969,6 +3969,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);
    --
    2.34.1


    \
     
     \ /
      Last update: 2022-03-17 14:00    [W:4.327 / U:0.256 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site