[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AM0PR04MB6004181BD078ABD918D4D008E717A@AM0PR04MB6004.eurprd04.prod.outlook.com>
Date: Mon, 14 Aug 2023 06:36:31 +0000
From: Gaurav Jain <gaurav.jain@....com>
To: Meenakshi Aggarwal <meenakshi.aggarwal@....com>,
Horia Geanta <horia.geanta@....com>,
Varun Sethi <V.Sethi@....com>,
Pankaj Gupta <pankaj.gupta@....com>,
"herbert@...dor.apana.org.au" <herbert@...dor.apana.org.au>,
"davem@...emloft.net" <davem@...emloft.net>,
"linux-crypto@...r.kernel.org" <linux-crypto@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] crypto: caam: fix unchecked return value error
Reviewed-by: Gaurav Jain <gaurav.jain@....com>
> -----Original Message-----
> From: Meenakshi Aggarwal <meenakshi.aggarwal@....com>
> Sent: Tuesday, August 8, 2023 4:25 PM
> To: Horia Geanta <horia.geanta@....com>; Varun Sethi <V.Sethi@....com>;
> Pankaj Gupta <pankaj.gupta@....com>; Gaurav Jain <gaurav.jain@....com>;
> herbert@...dor.apana.org.au; davem@...emloft.net; linux-
> crypto@...r.kernel.org; linux-kernel@...r.kernel.org
> Cc: Meenakshi Aggarwal <meenakshi.aggarwal@....com>
> Subject: [PATCH] crypto: caam: fix unchecked return value error
>
> From: Gaurav Jain <gaurav.jain@....com>
>
> 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@....com>
> Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@....com>
> ---
> drivers/crypto/caam/caampkc.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> 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;
>
> --
> 2.25.1
Powered by blists - more mailing lists