[<prev] [next>] [day] [month] [year] [list]
Message-ID: <2d0fd293-31a0-4116-a3ed-5e259864e561@stanley.mountain>
Date: Thu, 15 Aug 2024 14:20:20 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Pavitrakumar M <pavitrakumarm@...avyalabs.com>
Cc: Herbert Xu <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>,
Bhoomika K <bhoomikak@...avyalabs.com>,
Ruud Derwig <Ruud.Derwig@...opsys.com>,
linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 3/3] 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@...aro.org>
---
drivers/crypto/dwc-spacc/spacc_skcipher.c | 2 ++
1 file changed, 2 insertions(+)
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) +
--
2.43.0
Powered by blists - more mailing lists