mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-06-25 08:03:18 +00:00
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>
This commit is contained in:
parent
d2c3197922
commit
a5fe87e829
1 changed files with 3 additions and 1 deletions
|
@ -587,8 +587,10 @@ static void ldpaa_eth_stop(struct eth_device *net_dev)
|
||||||
#ifdef CONFIG_PHYLIB
|
#ifdef CONFIG_PHYLIB
|
||||||
if (priv->phydev && bus != NULL)
|
if (priv->phydev && bus != NULL)
|
||||||
phy_shutdown(priv->phydev);
|
phy_shutdown(priv->phydev);
|
||||||
else
|
else {
|
||||||
free(priv->phydev);
|
free(priv->phydev);
|
||||||
|
priv->phydev = NULL;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ldpaa_dpbp_free();
|
ldpaa_dpbp_free();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue