diff options
author | Randy Dunlap | 2006-07-12 05:49:41 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2006-09-26 06:08:39 +0200 |
commit | 10188012daa586ae7fcbef272e4db4f404741adf (patch) | |
tree | 2b8cc7eb3db24ad90684622cc155004c9fcb969b /lib/kobject.c | |
parent | Driver core: add ability for devices to create and remove bin files (diff) | |
download | kernel-qcow2-linux-10188012daa586ae7fcbef272e4db4f404741adf.tar.gz kernel-qcow2-linux-10188012daa586ae7fcbef272e4db4f404741adf.tar.xz kernel-qcow2-linux-10188012daa586ae7fcbef272e4db4f404741adf.zip |
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.c | 9 |
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 = { struct kobject *kobject_add_dir(struct kobject *parent, const char *name) { struct kobject *k; + int ret; if (!parent) return NULL; @@ -418,7 +419,13 @@ struct kobject *kobject_add_dir(struct kobject *parent, const char *name) k->parent = parent; k->ktype = &dir_ktype; kobject_set_name(k, name); - kobject_register(k); + ret = kobject_register(k); + if (ret < 0) { + printk(KERN_WARNING "kobject_add_dir: " + "kobject_register error: %d\n", ret); + kobject_del(k); + return NULL; + } return k; } |