1
0
Fork 0

Bluetooth: btusb: Fix memleak in btusb_mtk_submit_wmt_recv_urb

[ Upstream commit d33fe77bdf ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
5.4-rM2-2.2.x-imx-squashed
Dinghao Liu 2020-08-23 15:44:21 +08:00 committed by Greg Kroah-Hartman
parent 4886c2cf3d
commit 8f8df766f7
1 changed files with 1 additions and 0 deletions

View File

@ -2664,6 +2664,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;
}