diff mbox series

[1/2] crypto: tegra - Fix some error codes

Message ID ec425896-49eb-4099-9898-ac9509f6ab8f@moroto.mountain (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show
Series [1/2] crypto: tegra - Fix some error codes | expand

Commit Message

Dan Carpenter April 17, 2024, 6:12 p.m. UTC
Return negative -ENOMEM, instead of positive ENOMEM.

Fixes: 0880bb3b00c8 ("crypto: tegra - Add Tegra Security Engine driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/crypto/tegra/tegra-se-aes.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Dan Carpenter April 17, 2024, 6:14 p.m. UTC | #1
On Wed, Apr 17, 2024 at 09:12:32PM +0300, Dan Carpenter wrote:
> Return negative -ENOMEM, instead of positive ENOMEM.
> 
> Fixes: 0880bb3b00c8 ("crypto: tegra - Add Tegra Security Engine driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---

I didn't mean to put 1/2 in the subject...  Sorry about that.

regards,
dan carpenter
Jon Hunter April 17, 2024, 7:40 p.m. UTC | #2
On 17/04/2024 19:12, Dan Carpenter wrote:
> Return negative -ENOMEM, instead of positive ENOMEM.
> 
> Fixes: 0880bb3b00c8 ("crypto: tegra - Add Tegra Security Engine driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>   drivers/crypto/tegra/tegra-se-aes.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/crypto/tegra/tegra-se-aes.c b/drivers/crypto/tegra/tegra-se-aes.c
> index adc6cdab389e..ae7a0f8435fc 100644
> --- a/drivers/crypto/tegra/tegra-se-aes.c
> +++ b/drivers/crypto/tegra/tegra-se-aes.c
> @@ -1156,7 +1156,7 @@ static int tegra_ccm_do_one_req(struct crypto_engine *engine, void *areq)
>   	rctx->outbuf.buf = dma_alloc_coherent(ctx->se->dev, SE_AES_BUFLEN,
>   					      &rctx->outbuf.addr, GFP_KERNEL);
>   	if (!rctx->outbuf.buf) {
> -		ret = ENOMEM;
> +		ret = -ENOMEM;
>   		goto outbuf_err;
>   	}
>   
> @@ -1226,7 +1226,7 @@ static int tegra_gcm_do_one_req(struct crypto_engine *engine, void *areq)
>   	rctx->outbuf.buf = dma_alloc_coherent(ctx->se->dev, SE_AES_BUFLEN,
>   					      &rctx->outbuf.addr, GFP_KERNEL);
>   	if (!rctx->outbuf.buf) {
> -		ret = ENOMEM;
> +		ret = -ENOMEM;
>   		goto outbuf_err;
>   	}
>   

Reviewed-by: Jon Hunter <jonathanh@nvidia.com>

Thanks for fixing!

Jon
Akhil R April 18, 2024, 4:02 a.m. UTC | #3
> Return negative -ENOMEM, instead of positive ENOMEM.
> 
> Fixes: 0880bb3b00c8 ("crypto: tegra - Add Tegra Security Engine driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>  drivers/crypto/tegra/tegra-se-aes.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/crypto/tegra/tegra-se-aes.c b/drivers/crypto/tegra/tegra-se-
> aes.c
> index adc6cdab389e..ae7a0f8435fc 100644
> --- a/drivers/crypto/tegra/tegra-se-aes.c
> +++ b/drivers/crypto/tegra/tegra-se-aes.c
> @@ -1156,7 +1156,7 @@ static int tegra_ccm_do_one_req(struct crypto_engine
> *engine, void *areq)
>         rctx->outbuf.buf = dma_alloc_coherent(ctx->se->dev, SE_AES_BUFLEN,
>                                               &rctx->outbuf.addr, GFP_KERNEL);
>         if (!rctx->outbuf.buf) {
> -               ret = ENOMEM;
> +               ret = -ENOMEM;
>                 goto outbuf_err;
>         }
> 
> @@ -1226,7 +1226,7 @@ static int tegra_gcm_do_one_req(struct crypto_engine
> *engine, void *areq)
>         rctx->outbuf.buf = dma_alloc_coherent(ctx->se->dev, SE_AES_BUFLEN,
>                                               &rctx->outbuf.addr, GFP_KERNEL);
>         if (!rctx->outbuf.buf) {
> -               ret = ENOMEM;
> +               ret = -ENOMEM;
>                 goto outbuf_err;
>         }
> 
Thanks for the fix.

Acked-by: Akhil R <akhilrajeev@nvidia.com>
Thierry Reding April 19, 2024, 11:43 a.m. UTC | #4
On Wed Apr 17, 2024 at 8:12 PM CEST, Dan Carpenter wrote:
> Return negative -ENOMEM, instead of positive ENOMEM.
>
> Fixes: 0880bb3b00c8 ("crypto: tegra - Add Tegra Security Engine driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>  drivers/crypto/tegra/tegra-se-aes.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Acked-by: Thierry Reding <treding@nvidia.com>
Herbert Xu April 26, 2024, 9:32 a.m. UTC | #5
On Wed, Apr 17, 2024 at 09:12:32PM +0300, Dan Carpenter wrote:
> Return negative -ENOMEM, instead of positive ENOMEM.
> 
> Fixes: 0880bb3b00c8 ("crypto: tegra - Add Tegra Security Engine driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>  drivers/crypto/tegra/tegra-se-aes.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Patch applied.  Thanks.
diff mbox series

Patch

diff --git a/drivers/crypto/tegra/tegra-se-aes.c b/drivers/crypto/tegra/tegra-se-aes.c
index adc6cdab389e..ae7a0f8435fc 100644
--- a/drivers/crypto/tegra/tegra-se-aes.c
+++ b/drivers/crypto/tegra/tegra-se-aes.c
@@ -1156,7 +1156,7 @@  static int tegra_ccm_do_one_req(struct crypto_engine *engine, void *areq)
 	rctx->outbuf.buf = dma_alloc_coherent(ctx->se->dev, SE_AES_BUFLEN,
 					      &rctx->outbuf.addr, GFP_KERNEL);
 	if (!rctx->outbuf.buf) {
-		ret = ENOMEM;
+		ret = -ENOMEM;
 		goto outbuf_err;
 	}
 
@@ -1226,7 +1226,7 @@  static int tegra_gcm_do_one_req(struct crypto_engine *engine, void *areq)
 	rctx->outbuf.buf = dma_alloc_coherent(ctx->se->dev, SE_AES_BUFLEN,
 					      &rctx->outbuf.addr, GFP_KERNEL);
 	if (!rctx->outbuf.buf) {
-		ret = ENOMEM;
+		ret = -ENOMEM;
 		goto outbuf_err;
 	}