net: dsa: sja1105: Fix assigned yet unused return code rc
authorColin Ian King <colin.king@canonical.com>
Wed, 9 Jun 2021 17:43:53 +0000 (18:43 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Jun 2021 22:46:30 +0000 (15:46 -0700)
The return code variable rc is being set to return error values in two
places in sja1105_mdiobus_base_tx_register and yet it is not being
returned, the function always returns 0 instead. Fix this by replacing
the return 0 with the return code rc.

Addresses-Coverity: ("Unused value")
Fixes: 5a8f09748ee7 ("net: dsa: sja1105: register the MDIO buses for 100base-T1 and 100base-TX")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/sja1105/sja1105_mdio.c

index 8dfd063..08517c7 100644 (file)
@@ -171,7 +171,7 @@ static int sja1105_mdiobus_base_tx_register(struct sja1105_private *priv,
 out_put_np:
        of_node_put(np);
 
-       return 0;
+       return rc;
 }
 
 static void sja1105_mdiobus_base_tx_unregister(struct sja1105_private *priv)