summaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorDinghao Liu <dinghao.liu@zju.edu.cn>2020-08-23 15:44:21 +0800
committerMarcel Holtmann <marcel@holtmann.org>2020-08-31 18:03:08 +0200
commitd33fe77bdf75806d785dabf90d21d962122e5296 (patch)
tree531c7e2624921ee5893ca1461dcb28161ef99fec /drivers/bluetooth
parentdc45d375cfa5676ca40b67c40e568cdfb9fa915c (diff)
downloadlinux-d33fe77bdf75806d785dabf90d21d962122e5296.tar.bz2
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 <dinghao.liu@zju.edu.cn> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/btusb.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 414575eccbad..fe80588c7bd3 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;
}