Skip to content

Commit 3b1c9df

Browse files
Dan Carpenterherbertx
authored andcommitted
crypto: spacc - Check for allocation failure in spacc_skcipher_fallback()
Check for crypto_alloc_skcipher() failure. Fixes: c8981d9 ("crypto: spacc - Add SPAcc Skcipher support") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 8bc1bfa commit 3b1c9df

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/crypto/dwc-spacc/spacc_skcipher.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ static int spacc_skcipher_fallback(unsigned char *name,
6767
tctx->fb.cipher = crypto_alloc_skcipher(name,
6868
CRYPTO_ALG_TYPE_SKCIPHER,
6969
CRYPTO_ALG_NEED_FALLBACK);
70+
if (IS_ERR(tctx->fb.cipher))
71+
return PTR_ERR(tctx->fb.cipher);
7072

7173
crypto_skcipher_set_reqsize(reqtfm,
7274
sizeof(struct spacc_crypto_reqctx) +

0 commit comments

Comments
 (0)