bonding: use kobject_put instead of _del after kobject_add
authorVeaceslav Falico <vfalico@gmail.com>
Tue, 29 Jul 2014 11:27:43 +0000 (13:27 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 31 Jul 2014 18:16:09 +0000 (11:16 -0700)
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>
drivers/net/bonding/bond_sysfs_slave.c

index 198677f58ce0af4134b2491e90e6774fa2ae17b4..5cd532ca1cfe60a3c9cc7db4833db50f97442a6c 100644 (file)
@@ -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);
 }