]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: dsa: rtl8366: Check validity of passed VLANs
authorLinus Walleij <linus.walleij@linaro.org>
Tue, 1 Sep 2020 22:09:34 +0000 (00:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 09:07:40 +0000 (10:07 +0100)
commit6aa894ff3372f1e44e7c72288d45bb7a787486b6
tree930ecb81eb8dff234f69833b609a0d6aba8b95cf
parent701c56f568373906e11b55f0885e2965f3c785b3
net: dsa: rtl8366: Check validity of passed VLANs

[ Upstream commit 6641a2c42b0a307b7638d10e5d4b90debc61389d ]

The rtl8366_set_vlan() and rtl8366_set_pvid() get invalid
VLANs tossed at it, especially VLAN0, something the hardware
and driver cannot handle. Check validity and bail out like
we do in the other callbacks.

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
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