diff options
author | Gaurav Jain <gaurav.jain@nxp.com> | 2023-08-08 12:55:25 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-09-23 10:48:00 +0200 |
commit | e01260bd4185fca1e33e5bde856fc0fc73c42ac3 (patch) | |
tree | f2052c6cfba4962a383f9a77a8e4b4b11ebf82d9 /drivers | |
parent | 604cacbff4f777af04dc4f08f2fe8a79aa749882 (diff) | |
download | linux-stable-e01260bd4185fca1e33e5bde856fc0fc73c42ac3.tar.gz linux-stable-e01260bd4185fca1e33e5bde856fc0fc73c42ac3.tar.bz2 linux-stable-e01260bd4185fca1e33e5bde856fc0fc73c42ac3.zip |
crypto: caam - fix unchecked return value error
[ Upstream commit e30685204711a6be40dec2622606950ccd37dafe ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/crypto/caam/caampkc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/crypto/caam/caampkc.c b/drivers/crypto/caam/caampkc.c index f26d62e5533a..701e4ad8077b 100644 --- a/drivers/crypto/caam/caampkc.c +++ b/drivers/crypto/caam/caampkc.c @@ -194,7 +194,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; |