]> Gentwo Git Trees - linux/.git/commit
crypto: caam - Add check for kcalloc() in test_len()
authorGuangshuo Li <lgs201920130244@gmail.com>
Tue, 23 Sep 2025 12:44:18 +0000 (20:44 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 17 Oct 2025 08:03:57 +0000 (16:03 +0800)
commit7cf6e0b69b0d90ab042163e5bbddda0dfcf8b6a7
tree34aaada04b9f09778d9b67b3c3dd69878a61c356
parent59682835e134d0fd8690d960671145f00eb1ea47
crypto: caam - Add check for kcalloc() in test_len()

As kcalloc() may fail, check its return value to avoid a NULL pointer
dereference when passing the buffer to rng->read(). On allocation
failure, log the error and return since test_len() returns void.

Fixes: 2be0d806e25e ("crypto: caam - add a test for the RNG")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/caamrng.c