From: Dinghao Liu Date: Sun, 23 Aug 2020 07:44:21 +0000 (+0800) Subject: Bluetooth: btusb: Fix memleak in btusb_mtk_submit_wmt_recv_urb X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=d33fe77bdf75806d785dabf90d21d962122e5296;p=linux.git 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 Signed-off-by: Marcel Holtmann --- diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 414575eccbad7..fe80588c7bd3a 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -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; }