diff options
Diffstat (limited to 'net/dsa/dsa.c')
-rw-r--r-- | net/dsa/dsa.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index 45295ca09571..2bc62ea857c8 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c | |||
@@ -80,6 +80,7 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index, | |||
80 | int ret; | 80 | int ret; |
81 | char *name; | 81 | char *name; |
82 | int i; | 82 | int i; |
83 | bool valid_name_found = false; | ||
83 | 84 | ||
84 | /* | 85 | /* |
85 | * Probe for switch model. | 86 | * Probe for switch model. |
@@ -131,8 +132,13 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index, | |||
131 | } else { | 132 | } else { |
132 | ds->phys_port_mask |= 1 << i; | 133 | ds->phys_port_mask |= 1 << i; |
133 | } | 134 | } |
135 | valid_name_found = true; | ||
134 | } | 136 | } |
135 | 137 | ||
138 | if (!valid_name_found && i == DSA_MAX_PORTS) { | ||
139 | ret = -EINVAL; | ||
140 | goto out; | ||
141 | } | ||
136 | 142 | ||
137 | /* | 143 | /* |
138 | * If the CPU connects to this switch, set the switch tree | 144 | * If the CPU connects to this switch, set the switch tree |