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 <[email protected]>
---
 drivers/net/ti/am65-cpsw-nuss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ti/am65-cpsw-nuss.c b/drivers/net/ti/am65-cpsw-nuss.c
index 9b69f36d04d..723dde284fb 100644
--- a/drivers/net/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ti/am65-cpsw-nuss.c
@@ -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) {

---
base-commit: 007610da2cca405ea7739fc120d90085be4b6ac2
change-id: 20250806-net_ti_am65-5e3dc6d3df48

Best regards,
-- 
Andrew Goodbody <[email protected]>

Reply via email to