lkml.org 
[lkml]   [2020]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.8 251/633] net: dsa: rtl8366rb: Support all 4096 VLANs
    Date
    From: Linus Walleij <linus.walleij@linaro.org>

    [ 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>
    ---
    drivers/net/dsa/rtl8366rb.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/net/dsa/rtl8366rb.c b/drivers/net/dsa/rtl8366rb.c
    index fd1977590cb4b..c83b332656a4b 100644
    --- a/drivers/net/dsa/rtl8366rb.c
    +++ b/drivers/net/dsa/rtl8366rb.c
    @@ -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;
    --
    2.25.1


    \
     
     \ /
      Last update: 2020-10-27 16:13    [W:4.307 / U:0.168 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site