[PATCH] ecryptfs: bad allocation result check

From: Florin Malita
Date: Fri Nov 03 2006 - 14:51:43 EST


The kmalloc() result in* *ecryptfs_crypto_api_algify_cipher_name() is
assigned to an indirectly referenced pointer and not to the pointer
itself, so the current result check is incorrect.

Signed-off-by: Florin Malita <fmalita@xxxxxxxxx>
---

crypto.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
index f49f105..136175a 100644
--- a/fs/ecryptfs/crypto.c
+++ b/fs/ecryptfs/crypto.c
@@ -134,7 +134,7 @@ int ecryptfs_crypto_api_algify_cipher_na

algified_name_len = (chaining_modifier_len + cipher_name_len + 3);
(*algified_name) = kmalloc(algified_name_len, GFP_KERNEL);
- if (!(algified_name)) {
+ if (!(*algified_name)) {
rc = -ENOMEM;
goto out;
}


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