diff options
| author | Jiajia Liu <liujiajia@kylinos.cn> | 2026-05-18 10:24:02 +0800 |
|---|---|---|
| committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2026-05-20 16:35:47 -0400 |
| commit | dd1dda6b8d6e1f4376a5b3055a04f0ecbdb4d6bd (patch) | |
| tree | dba60ea7c1d05d84411b2831d81d8f5293e24041 /drivers/bluetooth | |
| parent | 84c24fb151fc1179355296d7ff29129ac7c42129 (diff) | |
| download | lwn-dd1dda6b8d6e1f4376a5b3055a04f0ecbdb4d6bd.tar.gz lwn-dd1dda6b8d6e1f4376a5b3055a04f0ecbdb4d6bd.zip | |
Bluetooth: btmtk: fix urb->setup_packet leak in error paths
The setup_packet of control urb is not freed if usb_submit_urb fails or
the submitted urb is killed. Add free in these two paths.
Fixes: a1c49c434e150 ("Bluetooth: btusb: Add protocol support for MediaTek MT7668U USB devices")
Signed-off-by: Jiajia Liu <liujiajia@kylinos.cn>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'drivers/bluetooth')
| -rw-r--r-- | drivers/bluetooth/btmtk.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c index a29f72216c34..8ff66b276af0 100644 --- a/drivers/bluetooth/btmtk.c +++ b/drivers/bluetooth/btmtk.c @@ -537,6 +537,7 @@ static void btmtk_usb_wmt_recv(struct urb *urb) return; } else if (urb->status == -ENOENT) { /* Avoid suspend failed when usb_kill_urb */ + kfree(urb->setup_packet); return; } @@ -610,6 +611,7 @@ static int btmtk_usb_submit_wmt_recv_urb(struct hci_dev *hdev) if (err != -EPERM && err != -ENODEV) bt_dev_err(hdev, "urb %p submission failed (%d)", urb, -err); + kfree(dr); usb_unanchor_urb(urb); } |
