[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <686180077.8704812.1763306985880@mail.yahoo.com>
Date: Sun, 16 Nov 2025 15:29:45 +0000 (UTC)
From: Mietek N <namiltd@...oo.com>
To: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Cc: "linus.walleij@...aro.org" <linus.walleij@...aro.org>,
"alsi@...g-olufsen.dk" <alsi@...g-olufsen.dk>,
"andrew@...n.ch" <andrew@...n.ch>,
"olteanv@...il.com" <olteanv@...il.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"kuba@...nel.org" <kuba@...nel.org>,
"pabeni@...hat.com" <pabeni@...hat.com>
Subject: [PATCH] rtl8365mb: initialize ret in phy_ocp_read and return ret in
phy_ocp_write
This patch fixes two issues in the RTL8365MB driver:
- Initialize the 'ret' variable in rtl8365mb_phy_ocp_read() to 0 to avoid
using an uninitialized automatic variable on some execution paths.
- Propagate the return value from rtl8365mb_phy_ocp_write() by returning
'ret' instead of always returning 0, so write failures are not silently
ignored.
No other changes are made and the PHY OCP helper functions themselves
remain functionally identical except for the corrected return behaviour.
Signed-off-by: Mieczyslaw Nalewaj <namiltd@...oo.com>
---
drivers/net/dsa/realtek/rtl8365mb.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff -ruN a/drivers/net/dsa/realtek/rtl8365mb.c b/drivers/net/dsa/realtek/rtl8365mb.c
--- a/drivers/net/dsa/realtek/rtl8365mb.c 2025-10-12 22:42:36.000000000 +0200
+++ b/drivers/net/dsa/realtek/rtl8365mb.c 2025-11-16 14:02:57.000000000 +0100
@@ -690,7 +690,7 @@
u32 ocp_addr, u16 *data)
{
u32 val;
- int ret;
+ int ret = 0;
rtl83xx_lock(priv);
@@ -769,7 +769,7 @@
out:
rtl83xx_unlock(priv);
- return 0;
+ return ret;
}
static int rtl8365mb_phy_read(struct realtek_priv *priv, int phy, int regnum)
--
2.39.3
Powered by blists - more mailing lists