mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
cx82310_eth: fix a memory leak bug
[ Upstream commit 1eca92eef1 ]
In cx82310_bind(), 'dev->partial_data' is allocated through kmalloc().
Then, the execution waits for the firmware to become ready. If the firmware
is not ready in time, the execution is terminated. However, the allocated
'dev->partial_data' is not deallocated on this path, leading to a memory
leak bug. To fix this issue, free 'dev->partial_data' before returning the
error.
Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1aca2008e2
commit
f51ddf3767
@@ -175,7 +175,8 @@ static int cx82310_bind(struct usbnet *dev, struct usb_interface *intf)
|
||||
}
|
||||
if (!timeout) {
|
||||
dev_err(&udev->dev, "firmware not ready in time\n");
|
||||
return -ETIMEDOUT;
|
||||
ret = -ETIMEDOUT;
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* enable ethernet mode (?) */
|
||||
|
||||
Reference in New Issue
Block a user