mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 15:11:16 +00:00
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>
This commit is contained in:
parent
2589f1887b
commit
10188012da
1 changed files with 8 additions and 1 deletions
|
@ -407,6 +407,7 @@ static struct kobj_type dir_ktype = {
|
||||||
struct kobject *kobject_add_dir(struct kobject *parent, const char *name)
|
struct kobject *kobject_add_dir(struct kobject *parent, const char *name)
|
||||||
{
|
{
|
||||||
struct kobject *k;
|
struct kobject *k;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (!parent)
|
if (!parent)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -418,7 +419,13 @@ struct kobject *kobject_add_dir(struct kobject *parent, const char *name)
|
||||||
k->parent = parent;
|
k->parent = parent;
|
||||||
k->ktype = &dir_ktype;
|
k->ktype = &dir_ktype;
|
||||||
kobject_set_name(k, name);
|
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;
|
return k;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue