From: Akinobu Mita Date: Tue, 28 Nov 2006 20:29:49 +0000 (-0800) Subject: [PATCH] ecryptfs: fix crypto_alloc_blkcipher() error check X-Git-Tag: v2.6.19~11 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=de88777e6942de76410ad2eb2858f5fbb6eb9c35;p=linux-2.6-omap-h63xx.git [PATCH] ecryptfs: fix crypto_alloc_blkcipher() error check The return value of crypto_alloc_blkcipher() should be checked by IS_ERR(). Cc: Mike Halcrow Cc: Phillip Hellewell Signed-off-by: Akinobu Mita Cc: Herbert Xu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index 136175a6933..f63a7755fe8 100644 --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c @@ -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);