Subject: [PATCH v4 net-next 1/2] net: phy: micrel: Fixed error related to uninitialized symbol ret

From: Divya Koppera <[email-masked]>
Date: Mon, 5 Dec 2022 16:05:49 +0530

Initialized return variable

Fixes Old smatch warnings:
drivers/net/phy/micrel.c:1750 ksz886x_cable_test_get_status() error:
uninitialized symbol 'ret'.

Reported-by: kernel test robot <[email-masked]>
Reported-by: Dan Carpenter <[email-masked]>
Fixes: 21b688dabecb ("net: phy: micrel: Cable Diag feature for lan8814 phy")
Signed-off-by: Divya Koppera <[email-masked]>
---
v3 -> v4:
- Split the patch for different warnings.

v1 -> v3:
- No changes
---
 drivers/net/phy/micrel.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 26ce0c5defcd..1bcdb828db56 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -2088,7 +2088,8 @@ static int ksz886x_cable_test_get_status(struct phy_device *phydev,
 	const struct kszphy_type *type = phydev->drv->driver_data;
 	unsigned long pair_mask = type->pair_mask;
 	int retries = 20;
-	int pair, ret;
+	int ret = 0;
+	int pair;
 
 	*finished = false;
 
-- 
2.17.1