From: Dave Young <hidave.darkstar@gmail.com>
To: Greg KH <gregkh@suse.de>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH 3/3] driver-core : make sysdev_class_register check kobject_set_name return value
Date: Mon, 11 May 2009 14:18:55 +0800 [thread overview]
Message-ID: <a8e1da0905102318w52d331fbv60849dd362906296@mail.gmail.com> (raw)
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>
---
drivers/base/sys.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff -uprN linux.old/drivers/base/sys.c linux.new/drivers/base/sys.c
--- linux.old/drivers/base/sys.c 2009-05-11 13:59:16.000000000 +0800
+++ linux.new/drivers/base/sys.c 2009-05-11 14:01:16.000000000 +0800
@@ -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_
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);
}
reply other threads:[~2009-05-11 6:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a8e1da0905102318w52d331fbv60849dd362906296@mail.gmail.com \
--to=hidave.darkstar@gmail.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®