net: dsa: remove phy_disconnect from error path
authorSascha Hauer <s.hauer@pengutronix.de>
Thu, 11 Feb 2016 10:44:49 +0000 (11:44 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 16 Feb 2016 21:04:08 +0000 (16:04 -0500)
The phy has not been initialized, disconnecting it in the error
path results in a NULL pointer exception. Drop the phy_disconnect
from the error path.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/slave.c

index 40b9ca72aae3da05c924b2d7adaa0825acfd398d..91e3b2ff364ab16ee55c5ebf8180aae498a32856 100644 (file)
@@ -1194,7 +1194,6 @@ int dsa_slave_create(struct dsa_switch *ds, struct device *parent,
        if (ret) {
                netdev_err(master, "error %d registering interface %s\n",
                           ret, slave_dev->name);
-               phy_disconnect(p->phy);
                ds->ports[port] = NULL;
                free_netdev(slave_dev);
                return ret;