summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorPrabhakar Kushwaha <prabhakar.kushwaha@nxp.com>2017-02-15 20:56:03 +0530
committerJoe Hershberger <joe.hershberger@ni.com>2017-08-14 12:47:33 -0500
commita5fe87e829487cb5589afba3b5d8c3adff3b077d (patch)
treeb435c59517aaea2fd10c2e84ac9d63debd560cb3 /drivers/net
parentd2c319792210c2db518235eb8e90979a311bbf73 (diff)
downloadu-boot-a5fe87e829487cb5589afba3b5d8c3adff3b077d.tar.gz
u-boot-a5fe87e829487cb5589afba3b5d8c3adff3b077d.tar.bz2
u-boot-a5fe87e829487cb5589afba3b5d8c3adff3b077d.zip
driver: net: ldpaa: Update priv->phydev after free()
Even after memory free of phydev, priv is still pointing to the obsolete address. So update priv->phydev as NULL after memory free. Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com> Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ldpaa_eth/ldpaa_eth.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ldpaa_eth/ldpaa_eth.c b/drivers/net/ldpaa_eth/ldpaa_eth.c
index 4e61700d5d..f235b622b6 100644
--- a/drivers/net/ldpaa_eth/ldpaa_eth.c
+++ b/drivers/net/ldpaa_eth/ldpaa_eth.c
@@ -587,8 +587,10 @@ static void ldpaa_eth_stop(struct eth_device *net_dev)
#ifdef CONFIG_PHYLIB
if (priv->phydev && bus != NULL)
phy_shutdown(priv->phydev);
- else
+ else {
free(priv->phydev);
+ priv->phydev = NULL;
+ }
#endif
ldpaa_dpbp_free();