[PATCH] ecryptfs: fix crypto_alloc_blkcipher() error check
The return value of crypto_alloc_blkcipher() should be checked by IS_ERR(). Cc: Mike Halcrow <mhalcrow@us.ibm.com> Cc: Phillip Hellewell <phillip@hellewell.homeip.net> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
3cce4856ff
commit
de88777e69
1 changed files with 2 additions and 1 deletions
|
@ -820,7 +820,8 @@ int ecryptfs_init_crypt_ctx(struct ecryptfs_crypt_stat *crypt_stat)
|
|||
crypt_stat->tfm = crypto_alloc_blkcipher(full_alg_name, 0,
|
||||
CRYPTO_ALG_ASYNC);
|
||||
kfree(full_alg_name);
|
||||
if (!crypt_stat->tfm) {
|
||||
if (IS_ERR(crypt_stat->tfm)) {
|
||||
rc = PTR_ERR(crypt_stat->tfm);
|
||||
ecryptfs_printk(KERN_ERR, "cryptfs: init_crypt_ctx(): "
|
||||
"Error initializing cipher [%s]\n",
|
||||
crypt_stat->cipher);
|
||||
|
|
Loading…
Reference in a new issue