From faac3a8d7d77bfc178d7257307a3a2bf74eb1939 Mon Sep 17 00:00:00 2001
From: Grygorii Strashko <grygorii.strashko@ti.com>
Date: Fri, 17 Sep 2021 17:00:21 +0300
Subject: [PATCH] net: ethernet: ti: icssg_prueth: fix llvm build warn

Fix:
drivers/net/ethernet/ti/icssg_prueth.c:2106:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
       if (!emac->cmd_wq)
           ^~~~~~~~~~~~~
drivers/net/ethernet/ti/icssg_prueth.c:2222:9: note: uninitialized use occurs here
       return ret;
              ^~~

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
---
 drivers/net/ethernet/ti/icssg_prueth.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ti/icssg_prueth.c b/drivers/net/ethernet/ti/icssg_prueth.c
index 70188d08a164..4470482062f9 100644
--- a/drivers/net/ethernet/ti/icssg_prueth.c
+++ b/drivers/net/ethernet/ti/icssg_prueth.c
@@ -2105,8 +2105,10 @@ static int prueth_netdev_init(struct prueth *prueth,
 	emac->ndev = ndev;
 	emac->port_id = port;
 	emac->cmd_wq = create_singlethread_workqueue("icssg_cmd_wq");
-	if (!emac->cmd_wq)
+	if (!emac->cmd_wq) {
+		ret = -ENOMEM;
 		goto free_ndev;
+	}
 	INIT_WORK(&emac->rx_mode_work, emac_ndo_set_rx_mode_work);
 
 	ret = pruss_request_mem_region(prueth->pruss,
