net: mediatek: Use correct variable for return
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Tue, 5 Aug 2025 11:04:00 +0000 (12:04 +0100)
committerJerome Forissier <jerome.forissier@linaro.org>
Mon, 18 Aug 2025 13:47:57 +0000 (15:47 +0200)
In mtk_eth_of_to_plat, the last error check has the value in
'priv->phy_addr' but returns ret. Correct to return 'priv->phy_addr'
instead.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
drivers/net/mtk_eth/mtk_eth.c

index 5d6a42b..b172838 100644 (file)
@@ -1461,7 +1461,7 @@ static int mtk_eth_of_to_plat(struct udevice *dev)
                priv->phy_addr = ofnode_read_s32_default(args.node, "reg", -1);
                if (priv->phy_addr < 0) {
                        printf("error: phy address is not specified\n");
-                       return ret;
+                       return priv->phy_addr;
                }
        }