All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Liu <jeff.liu@oracle.com>
To: gregkh@linuxfoundation.org
Cc: Christoph Lameter <cl@gentwo.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH 02/24] sample/kobject: update kset-example code
Date: Tue, 17 Jun 2014 22:26:47 +0800	[thread overview]
Message-ID: <53A05027.5020407@oracle.com> (raw)

From: Jie Liu <jeff.liu@oracle.com>
Subject: sample/kobject: update kset-example code

Check and return the error ptr if call kset_create_and_add() failed

Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jie Liu <jeff.liu@oracle.com>
---
 samples/kobject/kset-example.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/samples/kobject/kset-example.c b/samples/kobject/kset-example.c
index ab5e447..c2911d9 100644
--- a/samples/kobject/kset-example.c
+++ b/samples/kobject/kset-example.c
@@ -238,8 +238,8 @@ static int __init example_init(void)
 	 * located under /sys/kernel/
 	 */
 	example_kset = kset_create_and_add("kset_example", NULL, kernel_kobj);
-	if (!example_kset)
-		return -ENOMEM;
+	if (IS_ERR(example_kset))
+		return PTR_ERR(example_kset);
 
 	/*
 	 * Create three objects and register them with our kset
-- 
1.8.3.2

             reply	other threads:[~2014-06-17 14:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-17 14:26 Jeff Liu [this message]
2014-06-17 19:22 ` [PATCH 02/24] sample/kobject: update kset-example code Greg KH
2014-06-17 19:30   ` Christoph Lameter

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=53A05027.5020407@oracle.com \
    --to=jeff.liu@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@gentwo.org \
    --cc=gregkh@linuxfoundation.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.