public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Liu <jeff.liu@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Lameter <cl@gentwo.org>, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 07/24] kernel: return actual error on param_sysfs_init
Date: Tue, 17 Jun 2014 22:29:07 +0800	[thread overview]
Message-ID: <53A050B3.6050301@oracle.com> (raw)

From: Jie Liu <jeff.liu@oracle.com>

Return the actual error code if kset_create_and_add() failed

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Jie Liu <jeff.liu@oracle.com>
---
 kernel/params.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/kernel/params.c b/kernel/params.c
index 1e52ca2..a110987 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -928,10 +928,9 @@ struct kobj_type module_ktype = {
 static int __init param_sysfs_init(void)
 {
 	module_kset = kset_create_and_add("module", &module_uevent_ops, NULL);
-	if (!module_kset) {
-		printk(KERN_WARNING "%s (%d): error creating kset\n",
-			__FILE__, __LINE__);
-		return -ENOMEM;
+	if (IS_ERR(module_kset)) {
+		pr_warn("%s (%d): error creating kset\n", __FILE__, __LINE__);
+		return PTR_ERR(module_kset);
 	}
 	module_sysfs_initialized = 1;
 
-- 
1.8.3.2

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

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-17 14:29 Jeff Liu [this message]
2014-06-17 19:25 ` [PATCH 07/24] kernel: return actual error on param_sysfs_init Greg KH

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=53A050B3.6050301@oracle.com \
    --to=jeff.liu@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@gentwo.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox