Bluetooth: btmtk: fix URB leak in alloc_mtk_intr_urb error path

[ Upstream commit f396f40051 ]

When btmtk_isopkt_pad() fails, the previously allocated URB is not freed,
leaking the urb structure. Add usb_free_urb() before returning the error.

Fixes: ceac1cb025 ("Bluetooth: btusb: mediatek: add ISO data transmission functions")
Signed-off-by: Zhao Dongdong <zhaodongdong@kylinos.cn>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Zhao Dongdong
2026-07-24 16:16:09 +02:00
committed by Greg Kroah-Hartman
parent a0fd1086a5
commit 7f206a8d8d
+3 -1
View File
@@ -1051,8 +1051,10 @@ struct urb *alloc_mtk_intr_urb(struct hci_dev *hdev, struct sk_buff *skb,
if (!urb)
return ERR_PTR(-ENOMEM);
if (btmtk_isopkt_pad(hdev, skb))
if (btmtk_isopkt_pad(hdev, skb)) {
usb_free_urb(urb);
return ERR_PTR(-EINVAL);
}
pipe = usb_sndintpipe(btmtk_data->udev,
btmtk_data->isopkt_tx_ep->bEndpointAddress);