ecryptfs: bad allocation result check
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.
Signed-off-by Florin Malita <[email protected]>
---
crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ecryptfs/crypto.c +1 -1
@@ -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; }
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.