Skip to content
Snippets Groups Projects
Commit a5fe87e8 authored by Prabhakar Kushwaha's avatar Prabhakar Kushwaha Committed by Joe Hershberger
Browse files

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: default avatarPrabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
Signed-off-by: default avatarAshish Kumar <Ashish.Kumar@nxp.com>
Acked-by: default avatarJoe Hershberger <joe.hershberger@ni.com>
parent d2c31979
No related branches found
No related tags found
No related merge requests found
...@@ -587,8 +587,10 @@ static void ldpaa_eth_stop(struct eth_device *net_dev) ...@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment