aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/ldpaa_eth
diff options
context:
space:
mode:
authorPrabhakar Kushwaha2017-02-15 20:56:03 +0530
committerJoe Hershberger2017-08-14 12:47:33 -0500
commita5fe87e829487cb5589afba3b5d8c3adff3b077d (patch)
treeb435c59517aaea2fd10c2e84ac9d63debd560cb3 /drivers/net/ldpaa_eth
parentd2c319792210c2db518235eb8e90979a311bbf73 (diff)
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/ldpaa_eth')
-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 4e61700d5d1..f235b622b6f 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();