diff options
author | Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com> | 2017-02-15 20:56:03 +0530 |
---|---|---|
committer | Joe Hershberger <joe.hershberger@ni.com> | 2017-08-14 12:47:33 -0500 |
commit | a5fe87e829487cb5589afba3b5d8c3adff3b077d (patch) | |
tree | b435c59517aaea2fd10c2e84ac9d63debd560cb3 | |
parent | d2c319792210c2db518235eb8e90979a311bbf73 (diff) | |
download | u-boot-a5fe87e829487cb5589afba3b5d8c3adff3b077d.zip u-boot-a5fe87e829487cb5589afba3b5d8c3adff3b077d.tar.gz u-boot-a5fe87e829487cb5589afba3b5d8c3adff3b077d.tar.bz2 |
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>
-rw-r--r-- | drivers/net/ldpaa_eth/ldpaa_eth.c | 4 |
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 4e61700..f235b62 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(); |