* [PATCH] net: prestera: initialize err in prestera_port_sfp_bind
@ 2026-06-17 18:22 Ruoyu Wang
2026-06-17 18:44 ` Andrew Lunn
0 siblings, 1 reply; 2+ messages in thread
From: Ruoyu Wang @ 2026-06-17 18:22 UTC (permalink / raw)
To: Taras Chornyi, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Russell King, netdev, linux-kernel
prestera_port_sfp_bind() returns err after walking the ports node. If no
child node matches the port's front-panel id, err is never assigned.
Initialize it to 0 so the no-match path does not return stack data.
Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
---
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 41e19e9ad28d4..a82e7a8029851 100644
--- a/drivers/net/ethernet/marvell/prestera/prestera_main.c
+++ b/drivers/net/ethernet/marvell/prestera/prestera_main.c
@@ -373,7 +373,7 @@ static int prestera_port_sfp_bind(struct prestera_port *port)
struct device_node *ports, *node;
struct fwnode_handle *fwnode;
struct phylink *phy_link;
- int err;
+ int err = 0;
if (!sw->np)
return 0;
--
2.51.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] net: prestera: initialize err in prestera_port_sfp_bind
2026-06-17 18:22 [PATCH] net: prestera: initialize err in prestera_port_sfp_bind Ruoyu Wang
@ 2026-06-17 18:44 ` Andrew Lunn
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lunn @ 2026-06-17 18:44 UTC (permalink / raw)
To: Ruoyu Wang
Cc: Taras Chornyi, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Russell King, netdev, linux-kernel
On Thu, Jun 18, 2026 at 02:22:14AM +0800, Ruoyu Wang wrote:
> prestera_port_sfp_bind() returns err after walking the ports node. If no
> child node matches the port's front-panel id, err is never assigned.
> Initialize it to 0 so the no-match path does not return stack data.
Why 0, and not -ENODEV? Please include an explanation of your choice
in the commit message.
Please also take a read of
https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html
You need to indicate the tree this patch is for in the Subject:
Andrew
---
pw-bot: cr
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-17 18:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-17 18:22 [PATCH] net: prestera: initialize err in prestera_port_sfp_bind Ruoyu Wang
2026-06-17 18:44 ` Andrew Lunn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®