From: Andrew Lunn Date: Fri, 24 Oct 2014 21:44:04 +0000 (+0200) Subject: net: dsa: Error out on tagging protocol mismatches X-Git-Tag: v4.9.8~5423^2~31^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ae439286a0dec99cc8029868243689b5b5f3ff75;p=platform%2Fkernel%2Flinux-rpi3.git net: dsa: Error out on tagging protocol mismatches If there is a mismatch between enabled tagging protocols and the protocol the switch supports, error out, rather than continue with a situation which is unlikely to work. Signed-off-by: Andrew Lunn cc: alexander.h.duyck@intel.com Acked-by: Florian Fainelli Signed-off-by: David S. Miller --- diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index 22f34cf..6317b41 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c @@ -174,8 +174,11 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index, dst->rcv = brcm_netdev_ops.rcv; break; #endif - default: + case DSA_TAG_PROTO_NONE: break; + default: + ret = -ENOPROTOOPT; + goto out; } dst->tag_protocol = drv->tag_protocol;