Skip to content

Commit d33fe77

Browse files
dinghaoliuholtmann
authored andcommitted
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: Dinghao Liu <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent dc45d37 commit d33fe77

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/bluetooth/btusb.c

+1
Original file line numberDiff line numberDiff line change
@@ -2896,6 +2896,7 @@ static int btusb_mtk_submit_wmt_recv_urb(struct hci_dev *hdev)
28962896
buf = kmalloc(size, GFP_KERNEL);
28972897
if (!buf) {
28982898
kfree(dr);
2899+
usb_free_urb(urb);
28992900
return -ENOMEM;
29002901
}
29012902

0 commit comments

Comments
 (0)