public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH NET v2 1/1] net: usb: pegasus: fix memory leak in update_eth_regs_async()
@ 2026-01-06  8:48 Petko Manolov
  2026-01-08 16:50 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Petko Manolov @ 2026-01-06  8:48 UTC (permalink / raw)
  To: netdev; +Cc: davem, stable, pabeni, andrew, Petko Manolov

From: Petko Manolov <petkan@nucleusys.com>

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")
Signed-off-by: Petko Manolov <petkan@nucleusys.com>
---
v2:
  - replace the auto-cleanup form with the classic kfree();

 drivers/net/usb/pegasus.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c
index 81ca64debc5b..c514483134f0 100644
--- a/drivers/net/usb/pegasus.c
+++ b/drivers/net/usb/pegasus.c
@@ -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;
 }
-- 
2.52.0


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

end of thread, other threads:[~2026-01-08 16:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-06  8:48 [PATCH NET v2 1/1] net: usb: pegasus: fix memory leak in update_eth_regs_async() Petko Manolov
2026-01-08 16:50 ` patchwork-bot+netdevbpf

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