netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: dsa: properly disconnect the slave PHYs
@ 2016-10-18 12:12 John Crispin
  2016-10-18 12:29 ` Andrew Lunn
  0 siblings, 1 reply; 5+ messages in thread
From: John Crispin @ 2016-10-18 12:12 UTC (permalink / raw)
  To: Andrew Lunn, Vivien Didelot, Florian Fainelli, David S. Miller
  Cc: netdev, linux-kernel, John Crispin

The shutdown code only stopped the PHYs but does not diconnect them
properly. This could lead to null pointer deref related kernel oopses
during reboot. Fix this by calling phy_disconnect() after the PHYs are
stopped.

Signed-off-by: John Crispin <john@phrozen.org>
---
 net/dsa/slave.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 68714a5..725d9f7 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -154,8 +154,10 @@ static int dsa_slave_close(struct net_device *dev)
 	struct net_device *master = p->parent->dst->master_netdev;
 	struct dsa_switch *ds = p->parent;
 
-	if (p->phy)
+	if (p->phy) {
 		phy_stop(p->phy);
+		phy_disconnect(p->phy);
+	}
 
 	dev_mc_unsync(master, dev);
 	dev_uc_unsync(master, dev);
-- 
1.7.10.4

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

end of thread, other threads:[~2016-10-18 13:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-18 12:12 [PATCH] net: dsa: properly disconnect the slave PHYs John Crispin
2016-10-18 12:29 ` Andrew Lunn
2016-10-18 12:54   ` John Crispin
2016-10-18 13:24     ` Andrew Lunn
2016-10-18 13:27       ` John Crispin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).