mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
bonding: remove already created master sysfs link on failure
If slave sysfs symlink failes to be created - we end up without removing the master sysfs symlink. Remove it in case of failure. Signed-off-by: Veaceslav Falico <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
14134f6584
commit
9fe16b78ee
1 changed files with 5 additions and 0 deletions
|
|
@ -183,6 +183,11 @@ int bond_create_slave_symlinks(struct net_device *master,
|
|||
sprintf(linkname, "slave_%s", slave->name);
|
||||
ret = sysfs_create_link(&(master->dev.kobj), &(slave->dev.kobj),
|
||||
linkname);
|
||||
|
||||
/* free the master link created earlier in case of error */
|
||||
if (ret)
|
||||
sysfs_remove_link(&(slave->dev.kobj), "master");
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue