Subject: [PATCH net-next] net: marvell: prestera: uninitialized variable bug

From: Dan Carpenter <[email-masked]>
Date: Thu, 28 Jul 2022 17:32:36 +0300

The "ret" variable needs to be initialized at the start.

Fixes: 52323ef75414 ("net: marvell: prestera: add phylink support")
Signed-off-by: Dan Carpenter <[email-masked]>
---
 drivers/net/ethernet/marvell/prestera/prestera_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/prestera/prestera_main.c b/drivers/net/ethernet/marvell/prestera/prestera_main.c
index c267ca1ccdba..4b64bda3f9c2 100644
--- a/drivers/net/ethernet/marvell/prestera/prestera_main.c
+++ b/drivers/net/ethernet/marvell/prestera/prestera_main.c
@@ -847,7 +847,7 @@ static void prestera_event_handlers_unregister(struct prestera_switch *sw)
 static int prestera_switch_set_base_mac_addr(struct prestera_switch *sw)
 {
 	struct device_node *base_mac_np;
-	int ret;
+	int ret = 0;
 
 	if (sw->np) {
 		base_mac_np = of_parse_phandle(sw->np, "base-mac-provider", 0);
-- 
2.35.1