]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: dsa: mxl862xx: don't skip early bridge port configuration
authorDaniel Golle <daniel@makrotopia.org>
Tue, 7 Apr 2026 17:30:35 +0000 (18:30 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 10 Apr 2026 23:03:44 +0000 (16:03 -0700)
commit71934b9e6f36b1786bd969c0e1d2de8f9bd65f0f
tree570ab0c32bd9ac052c7fd917022c5d1769175753
parent3a4056ec7ec8f71ae9722f86d3cfbc4589deeac4
net: dsa: mxl862xx: don't skip early bridge port configuration

mxl862xx_bridge_port_set() is currently guarded by the
mxl8622_port->setup_done flag, as the early call to
mxl862xx_bridge_port_set() from mxl862xx_port_stp_state_set() would
otherwise cause a NULL-pointer dereference on unused ports which don't
have dp->cpu_dp despite not being a CPU port.

Using the setup_done flag (which is never set for unused ports),
however, also prevents mxl862xx_bridge_port_set() from configuring
user ports' single-port bridges early, which was unintended.

Fix this by returning early from mxl862xx_bridge_port_set() in case
dsa_port_is_unused().

Fixes: 340bdf984613c ("net: dsa: mxl862xx: implement bridge offloading")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Link: https://patch.msgid.link/15962aac29ebe0a6eb77565451acff880c41ef33.1775581804.git.daniel@makrotopia.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/mxl862xx/mxl862xx.c