mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ecryptfs: fix crypto_alloc_blkcipher() error check
@ 2006-11-27  5:01 Akinobu Mita
  0 siblings, 0 replies; only message in thread
From: Akinobu Mita @ 2006-11-27  5:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mike Halcrow, Phillip Hellewell

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>

---
 fs/ecryptfs/crypto.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: work-fault-inject/fs/ecryptfs/crypto.c
===================================================================
--- work-fault-inject.orig/fs/ecryptfs/crypto.c
+++ work-fault-inject/fs/ecryptfs/crypto.c
@@ -820,7 +820,8 @@ int ecryptfs_init_crypt_ctx(struct ecryp
 	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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-11-27  5:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-27  5:01 [PATCH] ecryptfs: fix crypto_alloc_blkcipher() error check Akinobu Mita

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome