浏览代码

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>
Andrew Lunn 10 年之前
父节点
当前提交
ae439286a0
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      net/dsa/dsa.c

+ 4 - 1
net/dsa/dsa.c

@@ -174,8 +174,11 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index,
 			dst->rcv = brcm_netdev_ops.rcv;
 			dst->rcv = brcm_netdev_ops.rcv;
 			break;
 			break;
 #endif
 #endif
-		default:
+		case DSA_TAG_PROTO_NONE:
 			break;
 			break;
+		default:
+			ret = -ENOPROTOOPT;
+			goto out;
 		}
 		}
 
 
 		dst->tag_protocol = drv->tag_protocol;
 		dst->tag_protocol = drv->tag_protocol;