All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] crypto: qce: skcipher: fix error return code in qce_skcipher_async_req_handle()
@ 2021-06-02 11:36 Wei Yongjun
  2021-06-08 22:42 ` Thara Gopinath
  2021-06-11  7:23 ` Herbert Xu
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2021-06-02 11:36 UTC (permalink / raw)
  To: weiyongjun1, Thara Gopinath, Herbert Xu, David S. Miller
  Cc: linux-crypto, linux-arm-msm, kernel-janitors, Hulk Robot

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 1339a7c3ba05 ("crypto: qce: skcipher: Fix incorrect sg count for dma transfers")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/crypto/qce/skcipher.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/qce/skcipher.c b/drivers/crypto/qce/skcipher.c
index 259418479227..8ff10928f581 100644
--- a/drivers/crypto/qce/skcipher.c
+++ b/drivers/crypto/qce/skcipher.c
@@ -124,13 +124,17 @@ qce_skcipher_async_req_handle(struct crypto_async_request *async_req)
 	rctx->dst_sg = rctx->dst_tbl.sgl;
 
 	dst_nents = dma_map_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst);
-	if (dst_nents < 0)
+	if (dst_nents < 0) {
+		ret = dst_nents;
 		goto error_free;
+	}
 
 	if (diff_dst) {
 		src_nents = dma_map_sg(qce->dev, req->src, rctx->src_nents, dir_src);
-		if (src_nents < 0)
+		if (src_nents < 0) {
+			ret = src_nents;
 			goto error_unmap_dst;
+		}
 		rctx->src_sg = req->src;
 	} else {
 		rctx->src_sg = rctx->dst_sg;


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] crypto: qce: skcipher: fix error return code in qce_skcipher_async_req_handle()
  2021-06-02 11:36 [PATCH -next] crypto: qce: skcipher: fix error return code in qce_skcipher_async_req_handle() Wei Yongjun
@ 2021-06-08 22:42 ` Thara Gopinath
  2021-06-11  7:23 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Thara Gopinath @ 2021-06-08 22:42 UTC (permalink / raw)
  To: Wei Yongjun, Herbert Xu, David S. Miller
  Cc: linux-crypto, linux-arm-msm, kernel-janitors, Hulk Robot



On 6/2/21 7:36 AM, Wei Yongjun wrote:
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
> 
> Fixes: 1339a7c3ba05 ("crypto: qce: skcipher: Fix incorrect sg count for dma transfers")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Reviewed-by: Thara Gopinath <thara.gopinath@linaro.org>

-- 
Warm Regards
Thara

> ---
>   drivers/crypto/qce/skcipher.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/crypto/qce/skcipher.c b/drivers/crypto/qce/skcipher.c
> index 259418479227..8ff10928f581 100644
> --- a/drivers/crypto/qce/skcipher.c
> +++ b/drivers/crypto/qce/skcipher.c
> @@ -124,13 +124,17 @@ qce_skcipher_async_req_handle(struct crypto_async_request *async_req)
>   	rctx->dst_sg = rctx->dst_tbl.sgl;
>   
>   	dst_nents = dma_map_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst);
> -	if (dst_nents < 0)
> +	if (dst_nents < 0) {
> +		ret = dst_nents;
>   		goto error_free;
> +	}
>   
>   	if (diff_dst) {
>   		src_nents = dma_map_sg(qce->dev, req->src, rctx->src_nents, dir_src);
> -		if (src_nents < 0)
> +		if (src_nents < 0) {
> +			ret = src_nents;
>   			goto error_unmap_dst;
> +		}
>   		rctx->src_sg = req->src;
>   	} else {
>   		rctx->src_sg = rctx->dst_sg;
> 



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] crypto: qce: skcipher: fix error return code in qce_skcipher_async_req_handle()
  2021-06-02 11:36 [PATCH -next] crypto: qce: skcipher: fix error return code in qce_skcipher_async_req_handle() Wei Yongjun
  2021-06-08 22:42 ` Thara Gopinath
@ 2021-06-11  7:23 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2021-06-11  7:23 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Thara Gopinath, David S. Miller, linux-crypto, linux-arm-msm,
	kernel-janitors, Hulk Robot

On Wed, Jun 02, 2021 at 11:36:45AM +0000, Wei Yongjun wrote:
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
> 
> Fixes: 1339a7c3ba05 ("crypto: qce: skcipher: Fix incorrect sg count for dma transfers")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/crypto/qce/skcipher.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-11  7:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-02 11:36 [PATCH -next] crypto: qce: skcipher: fix error return code in qce_skcipher_async_req_handle() Wei Yongjun
2021-06-08 22:42 ` Thara Gopinath
2021-06-11  7:23 ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.