Skip to content

Commit

Permalink
Bluetooth: btusb: Fix memleak in btusb_mtk_submit_wmt_recv_urb
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
dinghaoliu authored and holtmann committed Aug 31, 2020
1 parent dc45d37 commit d33fe77
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/bluetooth/btusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit d33fe77

Please sign in to comment.