public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: usb: pegasus: fix memory leak on usb_submit_urb() failure
@ 2025-12-16 18:41 Petko Manolov
  2025-12-16 18:43 ` kernel test robot
  2025-12-23 11:44 ` Paolo Abeni
  0 siblings, 2 replies; 6+ messages in thread
From: Petko Manolov @ 2025-12-16 18:41 UTC (permalink / raw)
  To: davem; +Cc: netdev, kuba, stable, Petko Manolov

In update_eth_regs_async() neither the URB nor the request structure are being
freed if usb_submit_urb() fails.  The patch fixes this long lurking bug in the
error path.

Signed-off-by: Petko Manolov <petko.manolov@konsulko.com>
---
 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..7a70207e7364 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);
+		kfree(req);
+		usb_free_urb(async_urb);
 	}
 	return ret;
 }
-- 
2.52.0


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

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

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-16 18:41 [PATCH] net: usb: pegasus: fix memory leak on usb_submit_urb() failure Petko Manolov
2025-12-16 18:43 ` kernel test robot
2025-12-23 11:44 ` Paolo Abeni
2026-01-02 12:10   ` Petko Manolov
2026-01-02 22:02     ` Andrew Lunn
2026-01-06  9:15       ` Petko Manolov

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