livepatch: Remove custom kobject state handling
authorPetr Mladek <pmladek@suse.com>
Fri, 3 May 2019 13:26:24 +0000 (15:26 +0200)
committerJiri Kosina <jkosina@suse.cz>
Fri, 3 May 2019 19:11:22 +0000 (21:11 +0200)
commit4d141ab3416d90f87775f5dee725efdf40110a8f
tree656f94323db25996373b1bd775147f709f2cb836
parent31adf2308f33dcae59009019675224be0978bc70
livepatch: Remove custom kobject state handling

kobject_init() always succeeds and sets the reference count to 1.
It allows to always free the structures via kobject_put() and
the related release callback.

Note that the custom kobject state handling was used only
because we did not know that kobject_put() can and actually
should get called even when kobject_init_and_add() fails.

The patch should not change the existing behavior.

Suggested-by: "Tobin C. Harding" <tobin@kernel.org>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Reviewed-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
include/linux/livepatch.h
kernel/livepatch/core.c