projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
14134f6
)
bonding: remove already created master sysfs link on failure
author
Veaceslav Falico
<vfalico@redhat.com>
Tue, 26 Mar 2013 16:43:28 +0000
(17:43 +0100)
committer
David S. Miller
<davem@davemloft.net>
Tue, 26 Mar 2013 17:00:02 +0000
(13:00 -0400)
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 <vfalico@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_sysfs.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/net/bonding/bond_sysfs.c
b/drivers/net/bonding/bond_sysfs.c
index 1c9e09fbdff8346e99413e0313d03ed401f463e2..db103e03ba05b4b32b2efbb168a820fe5f71f999 100644
(file)
--- a/
drivers/net/bonding/bond_sysfs.c
+++ b/
drivers/net/bonding/bond_sysfs.c
@@
-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;
}