aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_request.c
diff options
context:
space:
mode:
authorDmitry Antipov <[email protected]>2024-04-02 11:32:05 +0000
committerLuiz Augusto von Dentz <[email protected]>2024-04-10 19:03:44 +0000
commit45d355a926ab40f3ae7bc0b0a00cb0e3e8a5a810 (patch)
tree05f83c933c97c31e653e915c881686003215b771 /net/bluetooth/hci_request.c
parentBluetooth: hci_sync: Fix using the same interval and window for Coded PHY (diff)
downloadkernel-45d355a926ab40f3ae7bc0b0a00cb0e3e8a5a810.tar.gz
kernel-45d355a926ab40f3ae7bc0b0a00cb0e3e8a5a810.zip
Bluetooth: Fix memory leak in hci_req_sync_complete()
In 'hci_req_sync_complete()', always free the previous sync request state before assigning reference to a new one. Reported-by: [email protected] Closes: https://syzkaller.appspot.com/bug?extid=39ec16ff6cc18b1d066d Cc: [email protected] Fixes: f60cb30579d3 ("Bluetooth: Convert hci_req_sync family of function to new request API") Signed-off-by: Dmitry Antipov <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
Diffstat (limited to 'net/bluetooth/hci_request.c')
-rw-r--r--net/bluetooth/hci_request.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c
index 00e02138003e..efea25eb56ce 100644
--- a/net/bluetooth/hci_request.c
+++ b/net/bluetooth/hci_request.c
@@ -105,8 +105,10 @@ void hci_req_sync_complete(struct hci_dev *hdev, u8 result, u16 opcode,
if (hdev->req_status == HCI_REQ_PEND) {
hdev->req_result = result;
hdev->req_status = HCI_REQ_DONE;
- if (skb)
+ if (skb) {
+ kfree_skb(hdev->req_skb);
hdev->req_skb = skb_get(skb);
+ }
wake_up_interruptible(&hdev->req_wait_q);
}
}