aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kobject.c
diff options
context:
space:
mode:
authorRandy Dunlap <rdunlap@xenotime.net>2006-07-11 23:49:41 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-09-26 00:08:39 -0400
commit10188012daa586ae7fcbef272e4db4f404741adf (patch)
tree2b8cc7eb3db24ad90684622cc155004c9fcb969b /lib/kobject.c
parent2589f1887b0bf9f08ec3d7f3c5705ccb7c628076 (diff)
kobject: must_check fixes
Check all __must_check warnings in lib/kobject.c Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'lib/kobject.c')
-rw-r--r--lib/kobject.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/kobject.c b/lib/kobject.c
index 8e7c71993487..1699eb9161f3 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -407,6 +407,7 @@ static struct kobj_type dir_ktype = {
407struct kobject *kobject_add_dir(struct kobject *parent, const char *name) 407struct kobject *kobject_add_dir(struct kobject *parent, const char *name)
408{ 408{
409 struct kobject *k; 409 struct kobject *k;
410 int ret;
410 411
411 if (!parent) 412 if (!parent)
412 return NULL; 413 return NULL;
@@ -418,7 +419,13 @@ struct kobject *kobject_add_dir(struct kobject *parent, const char *name)
418 k->parent = parent; 419 k->parent = parent;
419 k->ktype = &dir_ktype; 420 k->ktype = &dir_ktype;
420 kobject_set_name(k, name); 421 kobject_set_name(k, name);
421 kobject_register(k); 422 ret = kobject_register(k);
423 if (ret < 0) {
424 printk(KERN_WARNING "kobject_add_dir: "
425 "kobject_register error: %d\n", ret);
426 kobject_del(k);
427 return NULL;
428 }
422 429
423 return k; 430 return k;
424} 431}