crypto: tegra - Fix some error codes
authorDan Carpenter <dan.carpenter@linaro.org>
Wed, 17 Apr 2024 18:12:32 +0000 (21:12 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 26 Apr 2024 09:26:09 +0000 (17:26 +0800)
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>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Acked-by: Akhil R <akhilrajeev@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/tegra/tegra-se-aes.c

index adc6cdab389e0b7f4b148a8714c36daaa63f7f64..ae7a0f8435fc63910f49044f91ca73fb9e6d6913 100644 (file)
@@ -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;
        }