Commit d33fe77b authored by Dinghao Liu's avatar Dinghao Liu Committed by Marcel Holtmann

Bluetooth: btusb: Fix memleak in btusb_mtk_submit_wmt_recv_urb

When kmalloc() on buf fails, urb should be freed just like
when kmalloc() on dr fails.
Signed-off-by: default avatarDinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent dc45d375
......@@ -2896,6 +2896,7 @@ static int btusb_mtk_submit_wmt_recv_urb(struct hci_dev *hdev)
buf = kmalloc(size, GFP_KERNEL);
if (!buf) {
kfree(dr);
usb_free_urb(urb);
return -ENOMEM;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment