Skip to contentSkip to conversation

net: usb: pegasus: fix memory leak in update_eth_regs_async()

PATCH Applied Petko Manolov 2 participants 2 messages Jan 6 – Jan 8

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net: usb: pegasus: fix memory leak in update_eth_regs_async()

From: Petko Manolov <[email protected]>

When asynchronously writing to the device registers and if usb_submit_urb() fail, the code fail to release allocated to this point resources.

Fixes 323b34963d11 ("drivers: net: usb: pegasus: fix control urb submission")

---
v2:
- replace the auto-cleanup form with the classic kfree();

 drivers/net/usb/pegasus.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/usb/pegasus.c +2 -0
index 81ca64debc5b..c514483134f0 100644
@@ -168,6 +168,8 @@ static int update_eth_regs_async(pegasus_t *pegasus)
 			netif_device_detach(pegasus->net);
 		netif_err(pegasus, drv, pegasus->net,
 			  "%s returned %d\n", __func__, ret);
+		usb_free_urb(async_urb);
+		kfree(req);
 	}
 	return ret;
 }
Signature · 1 line
2.52.0
#1 lore raw
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Tue, 6 Jan 2026 10:48:21 +0200 you wrote:

From: Petko Manolov <[email protected]>

When asynchronously writing to the device registers and if usb_submit_urb() fail, the code fail to release allocated to this point resources.

Fixes 323b34963d11 ("drivers: net: usb: pegasus: fix control urb submission")

[...]

Here is the summary with links:
- [NET,v2,1/1] net: usb: pegasus: fix memory leak in update_eth_regs_async()

    https://git.kernel.org/netdev/net/c/afa27621a28a

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html