Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Veaceslav Falico and committed by
David S. Miller
7afcaec4 c36c9d50

+2 -2
+2 -2
drivers/net/bonding/bond_sysfs_slave.c
··· 125 125 for (a = slave_attrs; *a; ++a) { 126 126 err = sysfs_create_file(&slave->kobj, &((*a)->attr)); 127 127 if (err) { 128 - kobject_del(&slave->kobj); 128 + kobject_put(&slave->kobj); 129 129 return err; 130 130 } 131 131 } ··· 140 140 for (a = slave_attrs; *a; ++a) 141 141 sysfs_remove_file(&slave->kobj, &((*a)->attr)); 142 142 143 - kobject_del(&slave->kobj); 143 + kobject_put(&slave->kobj); 144 144 }