[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211206101352.2713117-1-liu.yun@linux.dev>
Date: Mon, 6 Dec 2021 18:13:52 +0800
From: Jackie Liu <liu.yun@...ux.dev>
To: kabel@...nel.org
Cc: davem@...emloft.net, netdev@...r.kernel.org, liu.yun@...ux.dev
Subject: [PATCH] net: dsa: mv88e6xxx: fix uninit-value err in mv88e6393x_serdes_power
From: Jackie Liu <liuyun01@...inos.cn>
'err' is not initialized. If the value of cmode is not in the switch case,
it will cause a logic error and return early.
Fixes: 7527d66260ac ("net: dsa: mv88e6xxx: Save power by disabling SerDes trasmitter and receiver")
Reported-by: kernel-bot <kernel-robot@...inos.cn>
Signed-off-by: Jackie Liu <liuyun01@...inos.cn>
---
drivers/net/dsa/mv88e6xxx/serdes.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/mv88e6xxx/serdes.c b/drivers/net/dsa/mv88e6xxx/serdes.c
index 55273013bfb5..33727439724a 100644
--- a/drivers/net/dsa/mv88e6xxx/serdes.c
+++ b/drivers/net/dsa/mv88e6xxx/serdes.c
@@ -1507,7 +1507,7 @@ int mv88e6393x_serdes_power(struct mv88e6xxx_chip *chip, int port, int lane,
bool on)
{
u8 cmode = chip->ports[port].cmode;
- int err;
+ int err = 0;
if (port != 0 && port != 9 && port != 10)
return -EOPNOTSUPP;
--
2.25.1
Powered by blists - more mailing lists