提交 a5fe87e8 编写于 作者: P Prabhakar Kushwaha 提交者: Joe Hershberger

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: NPrabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
Signed-off-by: NAshish Kumar <Ashish.Kumar@nxp.com>
Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
上级 d2c31979
......@@ -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();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册