]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: dsa: rtl8366: Skip PVID setting if not requested
authorLinus Walleij <linus.walleij@linaro.org>
Fri, 18 Sep 2020 22:29:54 +0000 (00:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 09:07:41 +0000 (10:07 +0100)
[ Upstream commit 3dfe8dde093a07e82fa472c0f8c29a7f6a2006a5 ]

We go to lengths to determine whether the PVID should be set
for this port or not, and then fail to take it into account.
Fix this oversight.

Fixes: d8652956cf37 ("net: dsa: realtek-smi: Add Realtek SMI driver")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/dsa/rtl8366.c

index b941d45edd6415661ff8310140845877f266a862..49c626a336803d389fabae9ea55e80774b356df0 100644 (file)
@@ -436,6 +436,9 @@ void rtl8366_vlan_add(struct dsa_switch *ds, int port,
                                "failed to set up VLAN %04x",
                                vid);
 
+               if (!pvid)
+                       continue;
+
                ret = rtl8366_set_pvid(smi, port, vid);
                if (ret)
                        dev_err(smi->dev,