All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] driver: net: ldpaa: Update priv->phydev after free()
@ 2017-02-15 15:26 Ashish Kumar
  2017-02-15 23:52 ` Joe Hershberger
  2017-08-14 17:49 ` [U-Boot] " Joe Hershberger
  0 siblings, 2 replies; 9+ messages in thread
From: Ashish Kumar @ 2017-02-15 15:26 UTC (permalink / raw)
  To: u-boot

From: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>

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>
---
v2:
Add signoff

 drivers/net/ldpaa_eth/ldpaa_eth.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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();
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-08-14 17:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-15 15:26 [U-Boot] [PATCH v2] driver: net: ldpaa: Update priv->phydev after free() Ashish Kumar
2017-02-15 23:52 ` Joe Hershberger
2017-02-21  7:47   ` Ashish Kumar
2017-02-21 13:09     ` Er Krishna
2017-02-27 17:54       ` Joe Hershberger
2017-03-06 19:21     ` Ashish Kumar
2017-03-06 22:09     ` Joe Hershberger
2017-07-27 11:19       ` Ashish Kumar
2017-08-14 17:49 ` [U-Boot] " Joe Hershberger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.