]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
Bluetooth: Fix memory leak at end of hci requests
authorFrederic Dalleau <frederic.dalleau@collabora.co.uk>
Tue, 23 Aug 2016 05:59:19 +0000 (07:59 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 24 Aug 2016 14:49:29 +0000 (16:49 +0200)
commit9afee94939e3eda4c8bf239f7727cb56e158c976
treea981685cf5c9c52cabb3e54a204e46b912cfac8a
parentd7226c7a4dd19929d6df4ae04698da2fcf6f875a
Bluetooth: Fix memory leak at end of hci requests

In hci_req_sync_complete the event skb is referenced in hdev->req_skb.
It is used (via hci_req_run_skb) from either __hci_cmd_sync_ev which will
pass the skb to the caller, or __hci_req_sync which leaks.

unreferenced object 0xffff880005339a00 (size 256):
  comm "kworker/u3:1", pid 1011, jiffies 4294671976 (age 107.389s)
  backtrace:
    [<ffffffff818d89d9>] kmemleak_alloc+0x49/0xa0
    [<ffffffff8116bba8>] kmem_cache_alloc+0x128/0x180
    [<ffffffff8167c1df>] skb_clone+0x4f/0xa0
    [<ffffffff817aa351>] hci_event_packet+0xc1/0x3290
    [<ffffffff8179a57b>] hci_rx_work+0x18b/0x360
    [<ffffffff810692ea>] process_one_work+0x14a/0x440
    [<ffffffff81069623>] worker_thread+0x43/0x4d0
    [<ffffffff8106ead4>] kthread+0xc4/0xe0
    [<ffffffff818dd38f>] ret_from_fork+0x1f/0x40
    [<ffffffffffffffff>] 0xffffffffffffffff

Signed-off-by: Frédéric Dalleau <frederic.dalleau@collabora.co.uk>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/hci_request.c