diff options
author | Veaceslav Falico <vfalico@gmail.com> | 2014-07-29 13:27:43 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-07-31 11:16:09 -0700 |
commit | 7afcaec4969652e177cf0b247a1530ac927a20f8 (patch) | |
tree | 1853311000071bd3dd799252e9a407a18909b924 /drivers/net/bonding | |
parent | c36c9d50cc6af5c5bfcc195f21b73f55520c15f9 (diff) | |
download | talos-obmc-linux-7afcaec4969652e177cf0b247a1530ac927a20f8.tar.gz talos-obmc-linux-7afcaec4969652e177cf0b247a1530ac927a20f8.zip |
bonding: use kobject_put instead of _del after kobject_add
Otherwise the name of the kobject isn't getting freed and other stuff from
kobject_cleanup() isn't getting called. kobject_put() will call
kobject_del() on its own in kobject_cleanup().
CC: Jay Vosburgh <j.vosburgh@gmail.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r-- | drivers/net/bonding/bond_sysfs_slave.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/bonding/bond_sysfs_slave.c b/drivers/net/bonding/bond_sysfs_slave.c index 198677f58ce0..5cd532ca1cfe 100644 --- a/drivers/net/bonding/bond_sysfs_slave.c +++ b/drivers/net/bonding/bond_sysfs_slave.c @@ -125,7 +125,7 @@ int bond_sysfs_slave_add(struct slave *slave) for (a = slave_attrs; *a; ++a) { err = sysfs_create_file(&slave->kobj, &((*a)->attr)); if (err) { - kobject_del(&slave->kobj); + kobject_put(&slave->kobj); return err; } } @@ -140,5 +140,5 @@ void bond_sysfs_slave_del(struct slave *slave) for (a = slave_attrs; *a; ++a) sysfs_remove_file(&slave->kobj, &((*a)->attr)); - kobject_del(&slave->kobj); + kobject_put(&slave->kobj); } |