From: Daniel Golle Date: Tue, 7 Apr 2026 17:30:35 +0000 (+0100) Subject: net: dsa: mxl862xx: don't skip early bridge port configuration X-Git-Tag: v7.1-rc1~173^2~51^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71934b9e6f36b1786bd969c0e1d2de8f9bd65f0f;p=thirdparty%2Fkernel%2Flinux.git 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 Link: https://patch.msgid.link/15962aac29ebe0a6eb77565451acff880c41ef33.1775581804.git.daniel@makrotopia.org Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/dsa/mxl862xx/mxl862xx.c b/drivers/net/dsa/mxl862xx/mxl862xx.c index 9a9714c4859b1..f65525aff5e52 100644 --- a/drivers/net/dsa/mxl862xx/mxl862xx.c +++ b/drivers/net/dsa/mxl862xx/mxl862xx.c @@ -278,7 +278,7 @@ static int mxl862xx_set_bridge_port(struct dsa_switch *ds, int port) bool enable; int i, idx; - if (!p->setup_done) + if (dsa_port_is_unused(dp)) return 0; if (dsa_port_is_cpu(dp)) {