Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: btmtk: fix URB leak in alloc_mtk_intr_urb error path
@ 2026-06-04 11:46 Zhao Dongdong
  2026-06-04 12:35 ` bluez.test.bot
  2026-06-04 15:52 ` [PATCH] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Zhao Dongdong @ 2026-06-04 11:46 UTC (permalink / raw)
  To: matthias.bgg, angelogioacchino.delregno
  Cc: linux-bluetooth, linux-kernel, Zhao Dongdong

From: Zhao Dongdong <zhaodongdong@kylinos.cn>

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: ceac1cb0259d ("Bluetooth: btusb: mediatek: add ISO data transmission functions")
Signed-off-by: Zhao Dongdong <zhaodongdong@kylinos.cn>
---
 drivers/bluetooth/btmtk.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c
index 8ff66b276af0..c29e1841b2b3 100644
--- a/drivers/bluetooth/btmtk.c
+++ b/drivers/bluetooth/btmtk.c
@@ -1074,8 +1074,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);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: Bluetooth: btmtk: fix URB leak in alloc_mtk_intr_urb error path
  2026-06-04 11:46 [PATCH] Bluetooth: btmtk: fix URB leak in alloc_mtk_intr_urb error path Zhao Dongdong
@ 2026-06-04 12:35 ` bluez.test.bot
  2026-06-04 15:52 ` [PATCH] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2026-06-04 12:35 UTC (permalink / raw)
  To: linux-bluetooth, winter91

[-- Attachment #1: Type: text/plain, Size: 988 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1105907

---Test result---

Test Summary:
CheckPatch                    PASS      0.74 seconds
VerifyFixes                   PASS      0.14 seconds
VerifySignedoff               PASS      0.14 seconds
GitLint                       PASS      0.34 seconds
SubjectPrefix                 PASS      0.13 seconds
BuildKernel                   PASS      25.20 seconds
CheckAllWarning               PASS      27.98 seconds
CheckSparse                   PASS      26.29 seconds
BuildKernel32                 PASS      24.45 seconds
TestRunnerSetup               PASS      527.05 seconds
IncrementalBuild              PASS      24.45 seconds



https://github.com/bluez/bluetooth-next/pull/287

---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Bluetooth: btmtk: fix URB leak in alloc_mtk_intr_urb error path
  2026-06-04 11:46 [PATCH] Bluetooth: btmtk: fix URB leak in alloc_mtk_intr_urb error path Zhao Dongdong
  2026-06-04 12:35 ` bluez.test.bot
@ 2026-06-04 15:52 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2026-06-04 15:52 UTC (permalink / raw)
  To: Zhao Dongdong
  Cc: matthias.bgg, angelogioacchino.delregno, linux-bluetooth,
	linux-kernel, zhaodongdong

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Thu,  4 Jun 2026 19:46:40 +0800 you wrote:
> From: Zhao Dongdong <zhaodongdong@kylinos.cn>
> 
> 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: ceac1cb0259d ("Bluetooth: btusb: mediatek: add ISO data transmission functions")
> Signed-off-by: Zhao Dongdong <zhaodongdong@kylinos.cn>
> 
> [...]

Here is the summary with links:
  - Bluetooth: btmtk: fix URB leak in alloc_mtk_intr_urb error path
    https://git.kernel.org/bluetooth/bluetooth-next/c/c583e1de7ede

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-04 15:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-04 11:46 [PATCH] Bluetooth: btmtk: fix URB leak in alloc_mtk_intr_urb error path Zhao Dongdong
2026-06-04 12:35 ` bluez.test.bot
2026-06-04 15:52 ` [PATCH] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox