From: Linus Walleij Date: Fri, 18 Sep 2020 22:29:54 +0000 (+0200) Subject: net: dsa: rtl8366: Skip PVID setting if not requested X-Git-Tag: v4.19.153~46 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=2a919e725ff63275102dbe97719c3ee98097acb3;p=users%2Fdwmw2%2Flinux.git net: dsa: rtl8366: Skip PVID setting if not requested [ 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- diff --git a/drivers/net/dsa/rtl8366.c b/drivers/net/dsa/rtl8366.c index 4e1a2427fc314..dddbc86429bd9 100644 --- a/drivers/net/dsa/rtl8366.c +++ b/drivers/net/dsa/rtl8366.c @@ -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,