Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7afcaec4 authored by Veaceslav Falico's avatar Veaceslav Falico Committed by David S. Miller
Browse files

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: default avatarVeaceslav Falico <vfalico@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c36c9d50
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -125,7 +125,7 @@ int bond_sysfs_slave_add(struct slave *slave)
	for (a = slave_attrs; *a; ++a) {
	for (a = slave_attrs; *a; ++a) {
		err = sysfs_create_file(&slave->kobj, &((*a)->attr));
		err = sysfs_create_file(&slave->kobj, &((*a)->attr));
		if (err) {
		if (err) {
			kobject_del(&slave->kobj);
			kobject_put(&slave->kobj);
			return err;
			return err;
		}
		}
	}
	}
@@ -140,5 +140,5 @@ void bond_sysfs_slave_del(struct slave *slave)
	for (a = slave_attrs; *a; ++a)
	for (a = slave_attrs; *a; ++a)
		sysfs_remove_file(&slave->kobj, &((*a)->attr));
		sysfs_remove_file(&slave->kobj, &((*a)->attr));


	kobject_del(&slave->kobj);
	kobject_put(&slave->kobj);
}
}