From: Tobias Waldekranz Date: Fri, 18 Mar 2022 20:13:21 +0000 (+0100) Subject: net: dsa: mv88e6xxx: Ensure STU support in VLAN MSTI callback X-Git-Tag: v5.18-rc1~136^2~20^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bd48b911c88f017a97b1943201d23d6962968d1a;p=thirdparty%2Fkernel%2Flinux.git net: dsa: mv88e6xxx: Ensure STU support in VLAN MSTI callback In the same way that we check for STU support in the MST state callback, we should also verify it before trying to change a VLANs MSTI membership. Fixes: acaf4d2e36b3 ("net: dsa: mv88e6xxx: MST Offloading") Signed-off-by: Tobias Waldekranz Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Tested-by: Marek BehĂșn Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index b36393ba6d49e..afb9417ffca02 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -2678,6 +2678,9 @@ static int mv88e6xxx_vlan_msti_set(struct dsa_switch *ds, u8 old_sid, new_sid; int err; + if (!mv88e6xxx_has_stu(chip)) + return -EOPNOTSUPP; + mv88e6xxx_reg_lock(chip); err = mv88e6xxx_vtu_get(chip, msti->vid, &vlan);