]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: rtl8366: Fix VLAN set-up
authorLinus Walleij <linus.walleij@linaro.org>
Sun, 26 Jul 2020 23:34:40 +0000 (01:34 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 Jul 2020 00:44:23 +0000 (17:44 -0700)
commitcd6b1442735dfe1528cc724514d79759b7f15c01
tree294220b59b956e1590f5667f1169d02f421b4c4c
parentfb2f70a89385bb9bf3e3601ae46652bcdedcbce8
net: dsa: rtl8366: Fix VLAN set-up

Alter the rtl8366_vlan_add() to call rtl8366_set_vlan()
inside the loop that goes over all VIDs since we now
properly support calling that function more than once.
Augment the loop to postincrement as this is more
intuitive.

The loop moved past the last VID but called
rtl8366_set_vlan() with the port number instead of
the VID, assuming a 1-to-1 correspondence between
ports and VIDs. This was also a bug.

Cc: DENG Qingfang <dqfext@gmail.com>
Cc: Mauri Sandberg <sandberg@mailfence.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Fixes: 397676d73a0a ("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>
drivers/net/dsa/rtl8366.c