提交 10188012 编写于 作者: R Randy Dunlap 提交者: Greg Kroah-Hartman

kobject: must_check fixes

Check all __must_check warnings in lib/kobject.c
Signed-off-by: NRandy Dunlap <rdunlap@xenotime.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 2589f188
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册