Skip to contentSkip to conversation

bonding: use kobject_put instead of _del after kobject_add

PATCH In review Veaceslav Falico 2 participants 4 messages Jul 29, 2014 – Jul 31, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 <[email protected]>
CC Andy Gospodarek <[email protected]>
---
 drivers/net/bonding/bond_sysfs_slave.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/bonding/bond_sysfs_slave.c +2 -2
index 198677f..5cd532c 100644
@@ -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);
 }
Signature · 1 line
1.8.4
maintainer
#1 lore raw

From: Veaceslav Falico <[email protected]>
Date: Tue, 29 Jul 2014 13:27:43 +0200

Quoted 7 lines

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 <[email protected]>
CC Andy Gospodarek <[email protected]>

Introduced in v3.14, so maybe steer this to 'net' instead?

#2 lore raw
Quoted 7 lines · David Miller

From: Veaceslav Falico <[email protected]>
Date: Tue, 29 Jul 2014 13:27:43 +0200

Quoted 4 lines

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().

Quoted 5 lines
Quoted 3 lines
CC Jay Vosburgh <[email protected]>
CC Andy Gospodarek <[email protected]>

Introduced in v3.14, so maybe steer this to 'net' instead?

Good idea. Should I re-send it or can you just apply it to net?

maintainer
#3 lore raw

From: Veaceslav Falico <[email protected]>
Date: Thu, 31 Jul 2014 12:46:01 +0200

Quoted 9 lines · David Miller
Quoted 8 lines

From: Veaceslav Falico <[email protected]>
Date: Tue, 29 Jul 2014 13:27:43 +0200

Quoted 5 lines

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().

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
CC Jay Vosburgh <[email protected]>
CC Andy Gospodarek <[email protected]>

Introduced in v3.14, so maybe steer this to 'net' instead?

Good idea. Should I re-send it or can you just apply it to net?

I'll just apply it, thanks.