projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3925e6f
)
kobject: catch kobjects that are not initialized
author
Greg Kroah-Hartman
<
[email protected]
>
Tue, 26 Feb 2008 17:36:38 +0000
(09:36 -0800)
committer
Greg Kroah-Hartman
<
[email protected]
>
Sun, 20 Apr 2008 02:10:17 +0000
(19:10 -0700)
Add warnings to kobject_put() to catch kobjects that are cleaned up but
were never initialized to begin with.
Cc: Kay Sievers <
[email protected]
>
Cc: Hannes Reinecke <
[email protected]
>
Signed-off-by: Greg Kroah-Hartman <
[email protected]
>
lib/kobject.c
patch
|
blob
|
history
diff --git
a/lib/kobject.c
b/lib/kobject.c
index 0d03252f87a8535db2a9fe00632560c6fa337f24..60ae9e817663441a951d15098e057a4cbc366e03 100644
(file)
--- a/
lib/kobject.c
+++ b/
lib/kobject.c
@@
-592,8
+592,15
@@
static void kobject_release(struct kref *kref)
*/
void kobject_put(struct kobject *kobj)
{
- if (kobj)
+ if (kobj) {
+ if (!kobj->state_initialized) {
+ printk(KERN_WARNING "kobject: '%s' (%p): is not "
+ "initialized, yet kobject_put() is being "
+ "called.\n", kobject_name(kobj), kobj);
+ WARN_ON(1);
+ }
kref_put(&kobj->kref, kobject_release);
+ }
}
static void dynamic_kobj_release(struct kobject *kobj)