mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Randy.Dunlap" <rdunlap@xenotime.net>
To: lkml <linux-kernel@vger.kernel.org>
Cc: akpm <akpm@osdl.org>, gregkh <greg@kroah.com>
Subject: [PATCH -mm] kobject: must_check fixes
Date: Tue, 11 Jul 2006 20:49:41 -0700	[thread overview]
Message-ID: <20060711204941.a46da8bf.rdunlap@xenotime.net> (raw)

From: Randy Dunlap <rdunlap@xenotime.net>

Check all __must_check warnings in lib/kobject.c

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
---
 lib/kobject.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletion(-)

--- linux-2618-rc1mm1.orig/lib/kobject.c
+++ linux-2618-rc1mm1/lib/kobject.c
@@ -457,6 +457,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;
@@ -468,7 +469,13 @@ struct kobject *kobject_add_dir(struct k
 	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;
 }


---

                 reply	other threads:[~2006-07-12  3:52 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=20060711204941.a46da8bf.rdunlap@xenotime.net \
    --to=rdunlap@xenotime.net \
    --cc=akpm@osdl.org \
    --cc=greg@kroah.com \
    --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®