From fa2e6cf3fcf04ec9ee4ff75286bb41bfec7e85d8 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Mon, 21 Jan 2013 09:58:51 +0000 Subject: [PATCH] --- yaml --- r: 351544 b: refs/heads/master c: f9bf5a2ca6cc331f32e3dd9cf16ced7215d0e6e8 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/net/dsa/dsa.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 807269a361f8..835b8a6b5971 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f490be049ba0a3b194bed3a0dfbdcab1ef0ae063 +refs/heads/master: f9bf5a2ca6cc331f32e3dd9cf16ced7215d0e6e8 diff --git a/trunk/net/dsa/dsa.c b/trunk/net/dsa/dsa.c index 45295ca09571..2bc62ea857c8 100644 --- a/trunk/net/dsa/dsa.c +++ b/trunk/net/dsa/dsa.c @@ -80,6 +80,7 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index, int ret; char *name; int i; + bool valid_name_found = false; /* * Probe for switch model. @@ -131,8 +132,13 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index, } else { ds->phys_port_mask |= 1 << i; } + valid_name_found = true; } + if (!valid_name_found && i == DSA_MAX_PORTS) { + ret = -EINVAL; + goto out; + } /* * If the CPU connects to this switch, set the switch tree