linux/net/dsa
Florian Fainelli 53013c7743 net: dsa: handle non-existing PHYs on switch internal bus
In case there is no PHY at the designated address on the internal
switch, we would basically de-reference a null pointer here:

dsa_slave_phy_setup(...)
{
	p->phy = ds->slave_mii_bus->phy_map[p->port];
	phy_connect_direct(slave_dev, p->phy, dsa_slave_adjust_link,
				      ^------

This can be triggered when the platform configuration (platform_data or
Device Tree) indicates there should be a PHY device at this address, but
the HW is non-responsive, such that we cannot attach a PHY device at
this specific location.

Fix this by checking the return value prior to calling
phy_connect_direct().

CC: Andrew Lunn <andrew@lunn.ch>
Fixes: b31f65fb43 ("net: dsa: slave: Fix autoneg for phys on switch MDIO bus")
Reported-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Andrey Volkov <andrey.volkov@nexvision.fr>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-12-11 20:58:50 -05:00
..
dsa_priv.h net: dsa: allow switch drivers to implement suspend/resume hooks 2014-09-22 14:41:23 -04:00
dsa.c net: dsa: replace count*size kzalloc by kcalloc 2014-11-16 14:41:39 -05:00
Kconfig net: dsa: Add support for reporting switch chip temperatures 2014-10-30 14:54:11 -04:00
Makefile net: dsa: add Broadcom tag RX/TX handler 2014-08-27 22:59:40 -07:00
slave.c net: dsa: handle non-existing PHYs on switch internal bus 2014-12-11 20:58:50 -05:00
tag_brcm.c dsa: Split ops up, and avoid assigning tag_protocol and receive separately 2014-09-15 17:24:20 -04:00
tag_dsa.c net: dsa: Don't set skb->protocol on outgoing tagged packets 2014-10-30 14:54:10 -04:00
tag_edsa.c net: dsa: Don't set skb->protocol on outgoing tagged packets 2014-10-30 14:54:10 -04:00
tag_trailer.c net: dsa: Don't set skb->protocol on outgoing tagged packets 2014-10-30 14:54:10 -04:00