Skip to contentSkip to conversation

crypt: return actual error code on pcrypt_init

PATCH Applied Jeff Liu 2 participants 2 messages Jun 17, 2014

Subsystems (2)
lore
Share & tools
lore

Jeff Liu

author
#0 lore raw

PATCH 6/24 crypt: return actual error code on pcrypt_init

From: Jie Liu <[email protected]>

Return the actual error code if call kset_create_and_add() failed

Cc Herbert Xu <[email protected]>
Cc David S. Miller" <[email protected]>
---
 crypto/pcrypt.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
crypto/pcrypt.c +4 -2
index 309d345..053fb10 100644
@@ -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)
Signature · 1 line
1.8.3.2