diff options
author | Dave Young <hidave.darkstar@gmail.com> | 2009-05-11 14:18:55 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-15 21:30:24 -0700 |
commit | 9227c47bbdd87f276e08ed17877cc1649f5ed10a (patch) | |
tree | af576b46ed9825573a11321db63c4038b4abcd9f /drivers | |
parent | d9cd8f37855b012757818f31390e8f84db251c89 (diff) | |
download | kernel_samsung_smdk4412-9227c47bbdd87f276e08ed17877cc1649f5ed10a.zip kernel_samsung_smdk4412-9227c47bbdd87f276e08ed17877cc1649f5ed10a.tar.gz kernel_samsung_smdk4412-9227c47bbdd87f276e08ed17877cc1649f5ed10a.tar.bz2 |
driver-core: make sysdev_class_register check kobject_set_name return value
sysdev_class_register should check the kobject_set_name return value.
Add the return value checking code.
Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/base/sys.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/base/sys.c b/drivers/base/sys.c index 9742a78..162355c 100644 --- a/drivers/base/sys.c +++ b/drivers/base/sys.c @@ -131,6 +131,8 @@ static struct kset *system_kset; int sysdev_class_register(struct sysdev_class *cls) { + int retval; + pr_debug("Registering sysdev class '%s'\n", cls->name); INIT_LIST_HEAD(&cls->drivers); @@ -138,7 +140,11 @@ int sysdev_class_register(struct sysdev_class *cls) cls->kset.kobj.parent = &system_kset->kobj; cls->kset.kobj.ktype = &ktype_sysdev_class; cls->kset.kobj.kset = system_kset; - kobject_set_name(&cls->kset.kobj, cls->name); + + retval = kobject_set_name(&cls->kset.kobj, cls->name); + if (retval) + return retval; + return kset_register(&cls->kset); } |