Skip to content

Commit

Permalink
crypto: caam - fix unchecked return value error
Browse files Browse the repository at this point in the history
[ Upstream commit e306852 ]

error:
Unchecked return value (CHECKED_RETURN)
check_return: Calling sg_miter_next without checking return value

fix:
added check if(!sg_miter_next)

Fixes: 8a2a0dd ("crypto: caam - strip input zeros from RSA input buffer")
Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
jaingaurav2712 authored and gregkh committed Sep 13, 2023
1 parent 841d2ff commit 92651ce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/crypto/caam/caampkc.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@ static int caam_rsa_count_leading_zeros(struct scatterlist *sgl,
if (len && *buff)
break;

sg_miter_next(&miter);
if (!sg_miter_next(&miter))
break;

buff = miter.addr;
len = miter.length;

Expand Down

0 comments on commit 92651ce

Please sign in to comment.