Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1300137

[PATCH] ext4: Fix return code checking of crypto_alloc_ablkcipher()

From Richard Weinberger <richard@nod.at>
Newsgroups linux.kernel
Subject [PATCH] ext4: Fix return code checking of crypto_alloc_ablkcipher()
Date 2016-01-02 23:20 +0100
Message-ID <qMCGJ-5oA-5@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


This function does never return NULL, IS_ERR() is sufficent.

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 fs/ext4/crypto_key.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/crypto_key.c b/fs/ext4/crypto_key.c
index c5882b3..436ea2a 100644
--- a/fs/ext4/crypto_key.c
+++ b/fs/ext4/crypto_key.c
@@ -234,8 +234,8 @@ retry:
 		goto out;
 got_key:
 	ctfm = crypto_alloc_ablkcipher(cipher_str, 0, 0);
-	if (!ctfm || IS_ERR(ctfm)) {
-		res = ctfm ? PTR_ERR(ctfm) : -ENOMEM;
+	if (IS_ERR(ctfm)) {
+		res = PTR_ERR(ctfm);
 		printk(KERN_DEBUG
 		       "%s: error %d (inode %u) allocating crypto tfm\n",
 		       __func__, res, (unsigned) inode->i_ino);
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH] ext4: Fix return code checking of crypto_alloc_ablkcipher() Richard Weinberger <richard@nod.at> - 2016-01-02 23:20 +0100

csiph-web