mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 06:01:23 +00:00
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>
This commit is contained in:
parent
858ff38af7
commit
f17d858ed0
4 changed files with 8 additions and 1 deletions
|
@ -41,6 +41,11 @@ void hci_req_init(struct hci_request *req, struct hci_dev *hdev)
|
|||
req->err = 0;
|
||||
}
|
||||
|
||||
void hci_req_purge(struct hci_request *req)
|
||||
{
|
||||
skb_queue_purge(&req->cmd_q);
|
||||
}
|
||||
|
||||
static int req_run(struct hci_request *req, hci_req_complete_t complete,
|
||||
hci_req_complete_skb_t complete_skb)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue