diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2020-09-20 22:37:33 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-10-29 09:57:41 +0100 |
commit | 98d0b2742fe0c02d0f704a055041fd08caf289b6 (patch) | |
tree | d4fc80fc8248668c96b4c3bf8d916f8f9b645571 | |
parent | 06ba92787790d534d8b5e7a89339ee182eedf030 (diff) |
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: d8652956cf37 ("net: dsa: realtek-smi: Add Realtek SMI driver")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/net/dsa/rtl8366rb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/dsa/rtl8366rb.c b/drivers/net/dsa/rtl8366rb.c index f5cc8b0a7c74..7f731bf36998 100644 --- a/drivers/net/dsa/rtl8366rb.c +++ b/drivers/net/dsa/rtl8366rb.c @@ -1269,7 +1269,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; |