diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2008-05-15 01:35:04 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-05-15 01:35:04 -0400 |
commit | 38d2f38be9e4a2f1e3324c973a903aa972f71d0f (patch) | |
tree | f5a2b3b4cd26abefead85a723dc9e64494bf9e13 /drivers | |
parent | 0599ad53fee2d084f9ba26247d7452f06a40d298 (diff) |
bonding: handle case of device named bonding_master
If device already exists named bonding_masters, then fail. This is a wierd
corner case only a QA group could love.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/bonding/bond_sysfs.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index 68c41a00d93d..08f3d396bcd6 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c | |||
@@ -1437,8 +1437,16 @@ int bond_create_sysfs(void) | |||
1437 | * configure multiple bonding devices. | 1437 | * configure multiple bonding devices. |
1438 | */ | 1438 | */ |
1439 | if (ret == -EEXIST) { | 1439 | if (ret == -EEXIST) { |
1440 | netdev_class = NULL; | 1440 | /* Is someone being kinky and naming a device bonding_master? */ |
1441 | return 0; | 1441 | if (__dev_get_by_name(&init_net, |
1442 | class_attr_bonding_masters.attr.name)) | ||
1443 | printk(KERN_ERR | ||
1444 | "network device named %s already exists in sysfs", | ||
1445 | class_attr_bonding_masters.attr.name); | ||
1446 | else { | ||
1447 | netdev_class = NULL; | ||
1448 | return 0; | ||
1449 | } | ||
1442 | } | 1450 | } |
1443 | 1451 | ||
1444 | return ret; | 1452 | return ret; |