]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commit
Bluetooth: Fix potential memory leak
authorJaganath Kanakkassery <jaganath.k.os@gmail.com>
Wed, 25 Oct 2017 05:28:48 +0000 (10:58 +0530)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 29 Oct 2017 13:07:10 +0000 (14:07 +0100)
commitf17d858ed0a48270db4368d8cf370e3839ee6f4f
tree975b67fd9b1bf35c27320b25f11b8fa508d69a12
parent858ff38af77fc660092e82474ecc6ac135ed29fe
Bluetooth: Fix potential memory leak

If command is added to req then it should be freed in case if
hdev is down or HCI_ADVERTISING flag is set.

This introduces a helper in hci_request to purge the cmd_q
to make cmd_q internal to hci_request which is used to fix
the leak.

This also replace accessing of cmd_q in hci_conn with the
new helper.

Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/hci_conn.c
net/bluetooth/hci_request.c
net/bluetooth/hci_request.h
net/bluetooth/mgmt.c