From: gregkh@suse.de Subject: kobject warning stuff Good for development, don't push it to mainline as there are too many false positives. Signed-off-by: Greg Kroah-Hartman --- lib/kobject.c | 7 +++++++ 1 file changed, 7 insertions(+) --- gregkh-2.6.orig/lib/kobject.c +++ gregkh-2.6/lib/kobject.c @@ -126,6 +126,7 @@ char *kobject_get_path(struct kobject *k */ void kobject_init(struct kobject * kobj) { + WARN_ON(atomic_read(&kobj->kref.refcount)); kref_init(&kobj->kref); INIT_LIST_HEAD(&kobj->entry); init_waitqueue_head(&kobj->poll); @@ -362,6 +363,12 @@ void kobject_cleanup(struct kobject * ko kobj->k_name = NULL; if (t && t->release) t->release(kobj); + else + pr_debug("kobject '%s' does not have a release() function, " + "if this is not a directory kobject, it is broken " + "and must be fixed.\n", + kobj->name); + if (s) kset_put(s); if (parent)