]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: marvell: prestera: initialize err in prestera_port_sfp_bind
authorRuoyu Wang <ruoyuw560@gmail.com>
Wed, 17 Jun 2026 19:32:28 +0000 (03:32 +0800)
committerJakub Kicinski <kuba@kernel.org>
Sun, 21 Jun 2026 21:23:53 +0000 (14:23 -0700)
commit62b01f72d93c7bc8fde3b2e5b5f783eca5f53324
tree6639c35714543a3db6ae1d92530b73ff322e98f9
parent96e7f9122aae0ed000ee321f324b812a447906d9
net: marvell: prestera: initialize err in prestera_port_sfp_bind

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 err to 0 because absence of a matching optional port device
tree node is not an error. In that case no phylink is created and port
creation should continue with port->phy_link left NULL. Errors from
malformed matched nodes and phylink_create() still propagate.

Fixes: 52323ef75414 ("net: marvell: prestera: add phylink support")
Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Acked-by: Elad Nachman <enachman@marvell.com>
Link: https://patch.msgid.link/20260617193228.1653582-1-ruoyuw560@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/prestera/prestera_main.c