summaryrefslogtreecommitdiff
path: root/net/dsa/dsa.c
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2014-10-24 21:44:04 (GMT)
committerDavid S. Miller <davem@davemloft.net>2014-10-28 19:27:54 (GMT)
commitae439286a0dec99cc8029868243689b5b5f3ff75 (patch)
treee3b462eb507de0d5c882ad9b26dc36b67726b686 /net/dsa/dsa.c
parentf89b7755f517cdbb755d7543eef986ee9d54e654 (diff)
downloadlinux-ae439286a0dec99cc8029868243689b5b5f3ff75.tar.xz
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 <andrew@lunn.ch> cc: alexander.h.duyck@intel.com Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/dsa.c')
-rw-r--r--net/dsa/dsa.c5
1 files changed, 4 insertions, 1 deletions
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;