linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] crypto: mxs-dcp - return errcode in mxs_dcp_aes_enqueue and dcp_sha_update_fx
@ 2019-03-30  5:52 Yue Haibing
  2019-03-30 10:07 ` Mukesh Ojha
  2019-04-08  6:41 ` Herbert Xu
  0 siblings, 2 replies; 3+ messages in thread
From: Yue Haibing @ 2019-03-30  5:52 UTC (permalink / raw)
  To: herbert, davem, shawnguo, s.hauer, kernel, festevam, linux-imx
  Cc: linux-kernel, linux-crypto, linux-arm-kernel, YueHaibing

From: YueHaibing <yuehaibing@huawei.com>

'err' is set in err path, but it's not returned to callers.
Don't always return -EINPROGRESS, return err.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/crypto/mxs-dcp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/mxs-dcp.c b/drivers/crypto/mxs-dcp.c
index a2105cf..494cfc4 100644
--- a/drivers/crypto/mxs-dcp.c
+++ b/drivers/crypto/mxs-dcp.c
@@ -471,7 +471,7 @@ static int mxs_dcp_aes_enqueue(struct ablkcipher_request *req, int enc, int ecb)
 
 	wake_up_process(sdcp->thread[actx->chan]);
 
-	return -EINPROGRESS;
+	return ret;
 }
 
 static int mxs_dcp_aes_ecb_decrypt(struct ablkcipher_request *req)
@@ -797,7 +797,7 @@ static int dcp_sha_update_fx(struct ahash_request *req, int fini)
 	wake_up_process(sdcp->thread[actx->chan]);
 	mutex_unlock(&actx->mutex);
 
-	return -EINPROGRESS;
+	return ret;
 }
 
 static int dcp_sha_update(struct ahash_request *req)
-- 
2.7.0



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

* Re: [PATCH -next] crypto: mxs-dcp - return errcode in mxs_dcp_aes_enqueue and dcp_sha_update_fx
  2019-03-30  5:52 [PATCH -next] crypto: mxs-dcp - return errcode in mxs_dcp_aes_enqueue and dcp_sha_update_fx Yue Haibing
@ 2019-03-30 10:07 ` Mukesh Ojha
  2019-04-08  6:41 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Mukesh Ojha @ 2019-03-30 10:07 UTC (permalink / raw)
  To: Yue Haibing, herbert, davem, shawnguo, s.hauer, kernel, festevam,
	linux-imx
  Cc: linux-kernel, linux-crypto, linux-arm-kernel


On 3/30/2019 11:22 AM, Yue Haibing wrote:
> From: YueHaibing <yuehaibing@huawei.com>
>
> 'err' is set in err path, but it's not returned to callers.
> Don't always return -EINPROGRESS, return err.


how this one sounds ?

'err' is set in error path inside crypto_enqueue_request(), but this is not getting
returned upstream but, always EINPROGRESS. Fix this by returning appropriate error value.


>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>

Cheers,
-Mukesh


> ---
>   drivers/crypto/mxs-dcp.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/crypto/mxs-dcp.c b/drivers/crypto/mxs-dcp.c
> index a2105cf..494cfc4 100644
> --- a/drivers/crypto/mxs-dcp.c
> +++ b/drivers/crypto/mxs-dcp.c
> @@ -471,7 +471,7 @@ static int mxs_dcp_aes_enqueue(struct ablkcipher_request *req, int enc, int ecb)
>   
>   	wake_up_process(sdcp->thread[actx->chan]);
>   
> -	return -EINPROGRESS;
> +	return ret;
>   }
>   
>   static int mxs_dcp_aes_ecb_decrypt(struct ablkcipher_request *req)
> @@ -797,7 +797,7 @@ static int dcp_sha_update_fx(struct ahash_request *req, int fini)
>   	wake_up_process(sdcp->thread[actx->chan]);
>   	mutex_unlock(&actx->mutex);
>   
> -	return -EINPROGRESS;
> +	return ret;
>   }
>   
>   static int dcp_sha_update(struct ahash_request *req)

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

* Re: [PATCH -next] crypto: mxs-dcp - return errcode in mxs_dcp_aes_enqueue and dcp_sha_update_fx
  2019-03-30  5:52 [PATCH -next] crypto: mxs-dcp - return errcode in mxs_dcp_aes_enqueue and dcp_sha_update_fx Yue Haibing
  2019-03-30 10:07 ` Mukesh Ojha
@ 2019-04-08  6:41 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2019-04-08  6:41 UTC (permalink / raw)
  To: Yue Haibing
  Cc: davem, shawnguo, s.hauer, kernel, festevam, linux-imx,
	linux-kernel, linux-crypto, linux-arm-kernel

On Sat, Mar 30, 2019 at 01:52:21PM +0800, Yue Haibing wrote:
> From: YueHaibing <yuehaibing@huawei.com>
> 
> 'err' is set in err path, but it's not returned to callers.
> Don't always return -EINPROGRESS, return err.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/crypto/mxs-dcp.c | 4 ++--
>  1 file changed, 2 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:[~2019-04-08  6:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-30  5:52 [PATCH -next] crypto: mxs-dcp - return errcode in mxs_dcp_aes_enqueue and dcp_sha_update_fx Yue Haibing
2019-03-30 10:07 ` Mukesh Ojha
2019-04-08  6:41 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).