Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1513211
| From | Songjun Wu <songjun.wu@microchip.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] kobject: set state_initialized to 0 in kobject_cleanup |
| Date | 2016-11-01 11:50 +0100 |
| Message-ID | <syENH-7yd-5@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
If state_initialized is not set to 0 when a kobject is
released, a device is registered, unregistered, and
registered again, the error below will occur.
kobject (dec04bb0): tried to init an initialized object,
something is seriously wrong.
Signed-off-by: Songjun Wu <songjun.wu@microchip.com>
---
lib/kobject.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/kobject.c b/lib/kobject.c
index 445dcae..423af4e 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -639,6 +639,8 @@ static void kobject_cleanup(struct kobject *kobj)
kobject_del(kobj);
}
+ kobj->state_initialized = 0;
+
if (t && t->release) {
pr_debug("kobject: '%s' (%p): calling ktype release\n",
kobject_name(kobj), kobj);
--
2.7.4
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] kobject: set state_initialized to 0 in kobject_cleanup Songjun Wu <songjun.wu@microchip.com> - 2016-11-01 11:50 +0100
Re: [PATCH] kobject: set state_initialized to 0 in kobject_cleanup Greg KH <gregkh@linuxfoundation.org> - 2016-11-01 16:00 +0100
Re: [PATCH] kobject: set state_initialized to 0 in kobject_cleanup "Wu, Songjun" <Songjun.Wu@microchip.com> - 2016-11-02 02:40 +0100
csiph-web