diff options
Diffstat (limited to 'lib/kobject.c')
-rw-r--r-- | lib/kobject.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/kobject.c b/lib/kobject.c index 03d4ab349fa7..3b841b97fccd 100644 --- a/lib/kobject.c +++ b/lib/kobject.c | |||
@@ -576,8 +576,13 @@ void kobject_del(struct kobject *kobj) | |||
576 | */ | 576 | */ |
577 | struct kobject *kobject_get(struct kobject *kobj) | 577 | struct kobject *kobject_get(struct kobject *kobj) |
578 | { | 578 | { |
579 | if (kobj) | 579 | if (kobj) { |
580 | if (!kobj->state_initialized) | ||
581 | WARN(1, KERN_WARNING "kobject: '%s' (%p): is not " | ||
582 | "initialized, yet kobject_get() is being " | ||
583 | "called.\n", kobject_name(kobj), kobj); | ||
580 | kref_get(&kobj->kref); | 584 | kref_get(&kobj->kref); |
585 | } | ||
581 | return kobj; | 586 | return kobj; |
582 | } | 587 | } |
583 | 588 | ||