linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Liu <jeff.liu@oracle.com>
To: herbert@gondor.apana.org.au, davem@davemloft.net
Cc: linux-crypto@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 06/24] crypt: return actual error code on pcrypt_init
Date: Tue, 17 Jun 2014 22:29:02 +0800	[thread overview]
Message-ID: <53A050AE.2050401@oracle.com> (raw)

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

Return the actual error code if call kset_create_and_add() failed

Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: David S. Miller" <davem@davemloft.net>
Signed-off-by: Jie Liu <jeff.liu@oracle.com>
---
 crypto/pcrypt.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/crypto/pcrypt.c b/crypto/pcrypt.c
index 309d345..053fb10 100644
--- a/crypto/pcrypt.c
+++ b/crypto/pcrypt.c
@@ -523,11 +523,13 @@ static struct crypto_template pcrypt_tmpl = {
 
 static int __init pcrypt_init(void)
 {
-	int err = -ENOMEM;
+	int err;
 
 	pcrypt_kset = kset_create_and_add("pcrypt", NULL, kernel_kobj);
-	if (!pcrypt_kset)
+	if (IS_ERR(pcrypt_kset)) {
+		err = PTR_ERR(pcrypt_kset);
 		goto err;
+	}
 
 	err = pcrypt_init_padata(&pencrypt, "pencrypt");
 	if (err)
-- 
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:24 ` [PATCH 06/24] crypt: return actual error code on pcrypt_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=53A050AE.2050401@oracle.com \
    --to=jeff.liu@oracle.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).