diff options
| author | Jiri Kosina <jkosina@suse.cz> | 2013-03-18 10:57:32 +0100 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2013-03-18 10:57:57 +0100 |
| commit | aa1262b3876ec5249ff464618a7dcd46b3ca54e2 (patch) | |
| tree | b150bb2c83c073e1f0e298ba7899148f7d991ef7 /net/dsa/dsa.c | |
| parent | 806b2139db236e0cbd0b5833ab0ce139f0196bcd (diff) | |
| parent | 6dbe51c251a327e012439c4772097a13df43c5b8 (diff) | |
Merge branch 'master' into for-next
Sync with Linus' tree to be able to apply patch to the newly
added ITG-3200 driver.
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, 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 |
