Skip to content

Commit 7afcaec

Browse files
vfalicodavem330
authored andcommitted
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]> Signed-off-by: Veaceslav Falico <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c36c9d5 commit 7afcaec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/bonding/bond_sysfs_slave.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ int bond_sysfs_slave_add(struct slave *slave)
125125
for (a = slave_attrs; *a; ++a) {
126126
err = sysfs_create_file(&slave->kobj, &((*a)->attr));
127127
if (err) {
128-
kobject_del(&slave->kobj);
128+
kobject_put(&slave->kobj);
129129
return err;
130130
}
131131
}
@@ -140,5 +140,5 @@ void bond_sysfs_slave_del(struct slave *slave)
140140
for (a = slave_attrs; *a; ++a)
141141
sysfs_remove_file(&slave->kobj, &((*a)->attr));
142142

143-
kobject_del(&slave->kobj);
143+
kobject_put(&slave->kobj);
144144
}

0 commit comments

Comments
 (0)