]> git.baikalelectronics.ru Git - kernel.git/commit
net: vlan: Avoid using BUG() in vlan_proto_idx()
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 25 Sep 2020 00:27:44 +0000 (17:27 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 25 Sep 2020 21:12:18 +0000 (14:12 -0700)
commit33f495a7e5c2206587969dcc34ae0a2d1d6bf6e0
tree1128c50e3baff5b3b8016e4d6d8bf8355cb73bf2
parentef322d755f2e6fda4a636959d58bf215b54db5eb
net: vlan: Avoid using BUG() in vlan_proto_idx()

While we should always make sure that we specify a valid VLAN protocol
to vlan_proto_idx(), killing the machine when an invalid value is
specified is too harsh and not helpful for debugging. All callers are
capable of dealing with an error returned by vlan_proto_idx() so check
the index value and propagate it accordingly.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/8021q/vlan.c
net/8021q/vlan.h