Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

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>
Link: https://patch.msgid.link/20260106084821.3746677-1-petko.manolov@konsulko.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Petko Manolov and committed by
Jakub Kicinski
afa27621 a4e305ed

+2
+2
drivers/net/usb/pegasus.c
··· 168 168 netif_device_detach(pegasus->net); 169 169 netif_err(pegasus, drv, pegasus->net, 170 170 "%s returned %d\n", __func__, ret); 171 + usb_free_urb(async_urb); 172 + kfree(req); 171 173 } 172 174 return ret; 173 175 }