]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
net: ti: am65-cpsw-nuss: Initialise ret
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Wed, 6 Aug 2025 10:43:47 +0000 (11:43 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 15 Aug 2025 19:00:03 +0000 (13:00 -0600)
In am65_cpsw_phy_init it is not certain that ret will be assigned to
before it reaches the 'return ret' statement. Initialise ret to ensure
that ret is valid.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
drivers/net/ti/am65-cpsw-nuss.c

index 9b69f36d04dc85234cc2518ea294b22b92ce39f5..723dde284fbc9ab65280c9c2cdcc2fa06ea220b5 100644 (file)
@@ -628,7 +628,7 @@ static int am65_cpsw_phy_init(struct udevice *dev)
        struct eth_pdata *pdata = dev_get_plat(dev);
        struct phy_device *phydev;
        u32 supported = PHY_GBIT_FEATURES;
-       int ret;
+       int ret = 0;
 
        phydev = dm_eth_phy_connect(dev);
        if (!phydev) {