Skip to content

Commit ae43928

Browse files
lunndavem330
authored andcommitted
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>
1 parent f89b775 commit ae43928

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎net/dsa/dsa.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,11 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index,
174174
dst->rcv = brcm_netdev_ops.rcv;
175175
break;
176176
#endif
177-
default:
177+
case DSA_TAG_PROTO_NONE:
178178
break;
179+
default:
180+
ret = -ENOPROTOOPT;
181+
goto out;
179182
}
180183

181184
dst->tag_protocol = drv->tag_protocol;

0 commit comments

Comments
 (0)