]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:24:02 +0000 (08:24 +0200)
commitf089d7f2c97c4a2b25c6732d49ed0c74bbe4eccf
treefa3e05d8e05e1c13ccd2387065e3cee57d92d6ad
parent551f10f54cf22e1bd3581766a4ccef4bee932b89
net: dsa: rtl8366: Fix VLAN set-up

[ Upstream commit 788abc6d9d278ed6fa1fa94db2098481a04152b7 ]

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