diff mbox series

[net-next] net: dsa: rtl8366: Skip PVID setting if not requested

Message ID 20200918222954.210207-1-linus.walleij@linaro.org
State New
Headers show
Series [net-next] net: dsa: rtl8366: Skip PVID setting if not requested | expand

Commit Message

Linus Walleij Sept. 18, 2020, 10:29 p.m. UTC
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>
---
 drivers/net/dsa/rtl8366.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

David Miller Sept. 20, 2020, 9:11 p.m. UTC | #1
From: Linus Walleij <linus.walleij@linaro.org>
Date: Sat, 19 Sep 2020 00:29:54 +0200

> 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>

Applied, thanks.
diff mbox series

Patch

diff --git a/drivers/net/dsa/rtl8366.c b/drivers/net/dsa/rtl8366.c
index bd3c947976ce..c58ca324a4b2 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,