mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-31 08:04:55 +00:00
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>
This commit is contained in:
parent
0599ad53fe
commit
38d2f38be9
@ -1437,8 +1437,16 @@ int bond_create_sysfs(void)
|
|||||||
* configure multiple bonding devices.
|
* configure multiple bonding devices.
|
||||||
*/
|
*/
|
||||||
if (ret == -EEXIST) {
|
if (ret == -EEXIST) {
|
||||||
netdev_class = NULL;
|
/* Is someone being kinky and naming a device bonding_master? */
|
||||||
return 0;
|
if (__dev_get_by_name(&init_net,
|
||||||
|
class_attr_bonding_masters.attr.name))
|
||||||
|
printk(KERN_ERR
|
||||||
|
"network device named %s already exists in sysfs",
|
||||||
|
class_attr_bonding_masters.attr.name);
|
||||||
|
else {
|
||||||
|
netdev_class = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user