From: Dan Carpenter Date: Wed, 17 Apr 2024 18:12:32 +0000 (+0300) Subject: crypto: tegra - Fix some error codes X-Git-Tag: v6.10-rc5-pxa1908~397^2~24 X-Git-Url: https://git.dujemihanovic.xyz/?a=commitdiff_plain;h=5ae6d3f5c85cfc8d3ce60da776387062171cc174;p=linux.git crypto: tegra - Fix some error codes Return negative -ENOMEM, instead of positive ENOMEM. Fixes: 0880bb3b00c8 ("crypto: tegra - Add Tegra Security Engine driver") Signed-off-by: Dan Carpenter Reviewed-by: Jon Hunter Acked-by: Akhil R Acked-by: Thierry Reding Signed-off-by: Herbert Xu --- 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; }