projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d47cfdb
)
drivers: net: ldpaa_eth: fix resource leak
author
Pankaj Bansal
<pankaj.bansal@nxp.com>
Fri, 8 Feb 2019 08:46:11 +0000
(08:46 +0000)
committer
Joe Hershberger
<joe.hershberger@ni.com>
Wed, 8 May 2019 22:26:59 +0000
(17:26 -0500)
if an error occurs in ldpaa_eth_init, need to free all resources
before returning the error.
Threfore, free net_dev before returning from ldpaa_eth_init.
Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
drivers/net/ldpaa_eth/ldpaa_eth.c
patch
|
blob
|
history
diff --git
a/drivers/net/ldpaa_eth/ldpaa_eth.c
b/drivers/net/ldpaa_eth/ldpaa_eth.c
index 73b7ba29dfdc031ff5fc9e30c11a23f1d599c970..34253e39249d38ffec6725d18aa63c8f275f4b78 100644
(file)
--- a/
drivers/net/ldpaa_eth/ldpaa_eth.c
+++ b/
drivers/net/ldpaa_eth/ldpaa_eth.c
@@
-1074,6
+1074,7
@@
int ldpaa_eth_init(int dpmac_id, phy_interface_t enet_if)
priv = (struct ldpaa_eth_priv *)malloc(sizeof(struct ldpaa_eth_priv));
if (!priv) {
printf("ldpaa_eth_priv malloc() failed\n");
+ free(net_dev);
return -ENOMEM;
}
memset(priv, 0, sizeof(struct ldpaa_eth_priv));