* [U-Boot] [PATCH] drivers: net: ldpaa_eth: fix resource leak
@ 2019-02-08 8:46 Pankaj Bansal
2019-02-08 20:09 ` Joe Hershberger
2019-03-05 18:04 ` [U-Boot] " Joe Hershberger
0 siblings, 2 replies; 3+ messages in thread
From: Pankaj Bansal @ 2019-02-08 8:46 UTC (permalink / raw)
To: u-boot
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>
diff --git a/drivers/net/ldpaa_eth/ldpaa_eth.c b/drivers/net/ldpaa_eth/ldpaa_eth.c
index 73b7ba29df..34253e3924 100644
--- 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));
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] drivers: net: ldpaa_eth: fix resource leak
2019-02-08 8:46 [U-Boot] [PATCH] drivers: net: ldpaa_eth: fix resource leak Pankaj Bansal
@ 2019-02-08 20:09 ` Joe Hershberger
2019-03-05 18:04 ` [U-Boot] " Joe Hershberger
1 sibling, 0 replies; 3+ messages in thread
From: Joe Hershberger @ 2019-02-08 20:09 UTC (permalink / raw)
To: u-boot
On Fri, Feb 8, 2019 at 2:46 AM Pankaj Bansal <pankaj.bansal@nxp.com> wrote:
>
> 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>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] drivers: net: ldpaa_eth: fix resource leak
2019-02-08 8:46 [U-Boot] [PATCH] drivers: net: ldpaa_eth: fix resource leak Pankaj Bansal
2019-02-08 20:09 ` Joe Hershberger
@ 2019-03-05 18:04 ` Joe Hershberger
1 sibling, 0 replies; 3+ messages in thread
From: Joe Hershberger @ 2019-03-05 18:04 UTC (permalink / raw)
To: u-boot
Hi Pankaj,
https://patchwork.ozlabs.org/patch/1038527/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git
Thanks!
-Joe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-03-05 18:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-08 8:46 [U-Boot] [PATCH] drivers: net: ldpaa_eth: fix resource leak Pankaj Bansal
2019-02-08 20:09 ` Joe Hershberger
2019-03-05 18:04 ` [U-Boot] " Joe Hershberger
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.