Skip to contentSkip to conversation

ecryptfs: bad allocation result check

PATCH In review Florin Malita 2 participants 2 messages Nov 3, 2006 Ecrypt file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ecryptfs: bad allocation result check

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.

---

 crypto.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ecryptfs/crypto.c +1 -1
index f49f105..136175a 100644
@@ -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;
 	}
#1 lore raw
Quoted 3 lines · Florin Malita

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.

Thanks; this bug was already caught and fixed.