summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/caam
diff options
context:
space:
mode:
authorGaurav Jain <gaurav.jain@nxp.com>2023-08-08 12:55:25 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2023-08-18 11:01:08 +0200
commite30685204711a6be40dec2622606950ccd37dafe (patch)
tree0639ab7e50c816cfc488ae79976d3f7ed32322a0 /drivers/crypto/caam
parentcrypto: caam - fix PM operations definition (diff)
downloadlinux-e30685204711a6be40dec2622606950ccd37dafe.tar.xz
linux-e30685204711a6be40dec2622606950ccd37dafe.zip
crypto: caam - fix unchecked return value error
error: Unchecked return value (CHECKED_RETURN) check_return: Calling sg_miter_next without checking return value fix: added check if(!sg_miter_next) Fixes: 8a2a0dd35f2e ("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>
Diffstat (limited to 'drivers/crypto/caam')
-rw-r--r--drivers/crypto/caam/caampkc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/crypto/caam/caampkc.c b/drivers/crypto/caam/caampkc.c
index 72afc249d42f..7e08af751e4e 100644
--- a/drivers/crypto/caam/caampkc.c
+++ b/drivers/crypto/caam/caampkc.c
@@ -225,7 +225,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;