]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: usb: pegasus: fix memory leak in update_eth_regs_async()
authorPetko Manolov <petkan@nucleusys.com>
Tue, 6 Jan 2026 08:48:21 +0000 (10:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:12:11 +0000 (13:12 +0100)
[ Upstream commit afa27621a28af317523e0836dad430bec551eb54 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/usb/pegasus.c

index 138279bbb544b35aa5c1abbd9d9e83e86fef2d51..e3ddb990dc5435206ac49a66c713507909c50f7a 100644 (file)
@@ -193,6 +193,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;
 }