From: Prabhakar Kushwaha Date: Wed, 15 Feb 2017 15:26:03 +0000 (+0530) Subject: driver: net: ldpaa: Update priv->phydev after free() X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=a5fe87e829487cb5589afba3b5d8c3adff3b077d;p=u-boot.git 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 Signed-off-by: Ashish Kumar Acked-by: Joe Hershberger --- diff --git a/drivers/net/ldpaa_eth/ldpaa_eth.c b/drivers/net/ldpaa_eth/ldpaa_eth.c index 4e61700d5d..f235b622b6 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();