diff options
author | Dan Carpenter <dan.carpenter@linaro.org> | 2024-08-15 14:20:20 +0300 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2024-08-24 21:38:54 +0800 |
commit | 3b1c9df662915a18a86f1a88364ee70875ed3b44 (patch) | |
tree | 233759cfdf6742147753d7f166344372ea38cacd /drivers/crypto | |
parent | 8bc1bfa02e37d63632f0cb65543e3e71acdccafb (diff) | |
download | lwn-3b1c9df662915a18a86f1a88364ee70875ed3b44.tar.gz lwn-3b1c9df662915a18a86f1a88364ee70875ed3b44.zip |
crypto: spacc - Check for allocation failure in spacc_skcipher_fallback()
Check for crypto_alloc_skcipher() failure.
Fixes: c8981d9230d8 ("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>
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/dwc-spacc/spacc_skcipher.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/crypto/dwc-spacc/spacc_skcipher.c b/drivers/crypto/dwc-spacc/spacc_skcipher.c index 488c03ff6c36..8c698b75dd92 100644 --- a/drivers/crypto/dwc-spacc/spacc_skcipher.c +++ b/drivers/crypto/dwc-spacc/spacc_skcipher.c @@ -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) + |