summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Goodbody <[email protected]>2025-08-06 11:43:47 +0100
committerTom Rini <[email protected]>2025-08-15 13:00:03 -0600
commit1edd1fd539f52cadcb57c0c79c504f46f9540045 (patch)
tree8353083a91e54a18051861fa19c5a43fcc8e1969
parent145a6f447e47f679218f8886c06622b19f4e22a6 (diff)
net: ti: am65-cpsw-nuss: Initialise ret
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]>
-rw-r--r--drivers/net/ti/am65-cpsw-nuss.c2
1 files changed, 1 insertions, 1 deletions
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) {