crypto: spacc - Check for allocation failure in spacc_skcipher_fallback()

Check for crypto_alloc_skcipher() failure.

Fixes: c8981d9230 ("crypto: spacc - Add SPAcc Skcipher support")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Dan Carpenter
2024-08-15 14:20:20 +03:00
committed by Herbert Xu
parent 8bc1bfa02e
commit 3b1c9df662

View File

@@ -67,6 +67,8 @@ static int spacc_skcipher_fallback(unsigned char *name,
tctx->fb.cipher = crypto_alloc_skcipher(name,
CRYPTO_ALG_TYPE_SKCIPHER,
CRYPTO_ALG_NEED_FALLBACK);
if (IS_ERR(tctx->fb.cipher))
return PTR_ERR(tctx->fb.cipher);
crypto_skcipher_set_reqsize(reqtfm,
sizeof(struct spacc_crypto_reqctx) +