]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - drivers/net/tsec.c
net: tsec: Fix NULL access in case init_phy() fails
[karo-tx-uboot.git] / drivers / net / tsec.c
index 79d656133adb4d50a7a28dfb529f81121db708ac..dcdba4ea827190759ea9ab0de43239a02024a096 100644 (file)
@@ -597,6 +597,8 @@ static int init_phy(struct eth_device *dev)
                tsec_configure_serdes(priv);
 
        phydev = phy_connect(priv->bus, priv->phyaddr, dev, priv->interface);
+       if (!phydev)
+               return 0;
 
        phydev->supported &= supported;
        phydev->advertising = phydev->supported;