* [PATCH] ext4: Fix return code checking of crypto_alloc_ablkcipher()
@ 2016-01-02 22:11 Richard Weinberger
0 siblings, 0 replies; only message in thread
From: Richard Weinberger @ 2016-01-02 22:11 UTC (permalink / raw)
To: tytso; +Cc: adilger.kernel, linux-ext4, linux-kernel, Richard Weinberger
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-01-02 22:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-02 22:11 [PATCH] ext4: Fix return code checking of crypto_alloc_ablkcipher() Richard Weinberger
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).