Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eca79d81 authored by Linus Walleij's avatar Linus Walleij Committed by Greg Kroah-Hartman
Browse files

net: dsa: rtl8366rb: Support all 4096 VLANs



[ Upstream commit a7920efdd86d8a0d74402dbc80ead03b023294ba ]

There is an off-by-one error in rtl8366rb_is_vlan_valid()
making VLANs 0..4094 valid while it should be 1..4095.
Fix it.

Fixes: d8652956 ("net: dsa: realtek-smi: Add Realtek SMI driver")
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 2a919e72
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1270,7 +1270,7 @@ static bool rtl8366rb_is_vlan_valid(struct realtek_smi *smi, unsigned int vlan)
	if (smi->vlan4k_enabled)
		max = RTL8366RB_NUM_VIDS - 1;

	if (vlan == 0 || vlan >= max)
	if (vlan == 0 || vlan > max)
		return false;

	return true;