Commit afa27621 authored by Petko Manolov's avatar Petko Manolov Committed by Jakub Kicinski
Browse files

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: 323b3496 ("drivers: net: usb: pegasus: fix control urb submission")
Signed-off-by: default avatarPetko Manolov <petkan@nucleusys.com>
Link: https://patch.msgid.link/20260106084821.3746677-1-petko.manolov@konsulko.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent a4e305ed
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;
}