dsa: slave: Don't reference NULL pointer during phy_disconnect
authorAndrew Lunn <andrew@lunn.ch>
Fri, 11 Mar 2016 23:01:37 +0000 (00:01 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Mar 2016 19:43:10 +0000 (15:43 -0400)
commitb71be352f76ac3c0559feec2fd960ab9c31404c9
tree4f49a80ac245645735c74989efe5d233a8697968
parentca3dfa51e67cd41f6514b84a88bc101e8b1a139a
dsa: slave: Don't reference NULL pointer during phy_disconnect

When the phy is disconnected, the parent pointer to the netdev it was
attached to is set to NULL. The code then tries to suspend the phy,
but dsa_slave_fixed_link_update needs the parent pointer to determine
which switch the phy is connected to. So it dereferenced a NULL
pointer. Check for this condition.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/slave.c