net: dsa: mt7530: return mt7530_setup_mdio & mt7531_setup_common on error
authorArınç ÜNAL <arinc.unal@arinc9.com>
Mon, 22 Apr 2024 07:15:15 +0000 (10:15 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Apr 2024 10:57:02 +0000 (11:57 +0100)
The mt7530_setup_mdio() and mt7531_setup_common() functions should be
checked for errors. Return if the functions return a non-zero value.

Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mt7530.c

index 83436723cb165063d718bc1c1fbead785b1f4c68..4e9aa78ca3d0ab6e1e3929addcb919394bbc8a6b 100644 (file)
@@ -2667,7 +2667,9 @@ mt7531_setup(struct dsa_switch *ds)
                                         0);
        }
 
-       mt7531_setup_common(ds);
+       ret = mt7531_setup_common(ds);
+       if (ret)
+               return ret;
 
        /* Setup VLAN ID 0 for VLAN-unaware bridges */
        ret = mt7530_setup_vlan0(priv);
@@ -3020,6 +3022,8 @@ mt753x_setup(struct dsa_switch *ds)
        ret = mt7530_setup_mdio(priv);
        if (ret && priv->irq)
                mt7530_free_irq_common(priv);
+       if (ret)
+               return ret;
 
        /* Initialise the PCS devices */
        for (i = 0; i < priv->ds->num_ports; i++) {