aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_request.h
diff options
context:
space:
mode:
authorJaganath Kanakkassery <jaganath.k.os@gmail.com>2017-10-25 10:58:48 +0530
committerMarcel Holtmann <marcel@holtmann.org>2017-10-29 14:07:10 +0100
commitf17d858ed0a48270db4368d8cf370e3839ee6f4f (patch)
tree975b67fd9b1bf35c27320b25f11b8fa508d69a12 /net/bluetooth/hci_request.h
parentBluetooth: btusb: Add new NFA344A entry. (diff)
downloadlinux-dev-f17d858ed0a48270db4368d8cf370e3839ee6f4f.tar.xz
linux-dev-f17d858ed0a48270db4368d8cf370e3839ee6f4f.zip
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>
Diffstat (limited to 'net/bluetooth/hci_request.h')
-rw-r--r--net/bluetooth/hci_request.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/bluetooth/hci_request.h b/net/bluetooth/hci_request.h
index dde77bd59f91..702beb140d9f 100644
--- a/net/bluetooth/hci_request.h
+++ b/net/bluetooth/hci_request.h
@@ -36,6 +36,7 @@ struct hci_request {
};
void hci_req_init(struct hci_request *req, struct hci_dev *hdev);
+void hci_req_purge(struct hci_request *req);
int hci_req_run(struct hci_request *req, hci_req_complete_t complete);
int hci_req_run_skb(struct hci_request *req, hci_req_complete_skb_t complete);
void hci_req_add(struct hci_request *req, u16 opcode, u32 plen,