net: dsa: mv88e6xxx: Ensure STU support in VLAN MSTI callback
authorTobias Waldekranz <tobias@waldekranz.com>
Fri, 18 Mar 2022 20:13:21 +0000 (21:13 +0100)
committerJakub Kicinski <kuba@kernel.org>
Mon, 21 Mar 2022 22:51:51 +0000 (15:51 -0700)
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 <tobias@waldekranz.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Tested-by: Marek BehĂșn <kabel@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/mv88e6xxx/chip.c

index b36393b..afb9417 100644 (file)
@@ -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);