Commit 04dcf1ce authored by Li Huafei's avatar Li Huafei Committed by Greg Kroah-Hartman
Browse files

crypto: inside-secure - Fix the return value of safexcel_xcbcmac_cra_init()



[ Upstream commit a10549fc ]

The commit 320406cb ("crypto: inside-secure - Replace generic aes
with libaes") replaced crypto_alloc_cipher() with kmalloc(), but did not
modify the handling of the return value. When kmalloc() returns NULL,
PTR_ERR_OR_ZERO(NULL) returns 0, but in fact, the memory allocation has
failed, and -ENOMEM should be returned.

Fixes: 320406cb ("crypto: inside-secure - Replace generic aes with libaes")
Signed-off-by: default avatarLi Huafei <lihuafei1@huawei.com>
Acked-by: default avatarAntoine Tenart <atenart@kernel.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 2a80e710
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment