1

crypto: tegra - Fix some error codes

Return negative -ENOMEM, instead of positive ENOMEM.

Fixes: 0880bb3b00 ("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>
This commit is contained in:
Dan Carpenter 2024-04-17 21:12:32 +03:00 committed by Herbert Xu
parent ee2615fa4d
commit 5ae6d3f5c8

View 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.buf = dma_alloc_coherent(ctx->se->dev, SE_AES_BUFLEN,
&rctx->outbuf.addr, GFP_KERNEL); &rctx->outbuf.addr, GFP_KERNEL);
if (!rctx->outbuf.buf) { if (!rctx->outbuf.buf) {
ret = ENOMEM; ret = -ENOMEM;
goto outbuf_err; 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.buf = dma_alloc_coherent(ctx->se->dev, SE_AES_BUFLEN,
&rctx->outbuf.addr, GFP_KERNEL); &rctx->outbuf.addr, GFP_KERNEL);
if (!rctx->outbuf.buf) { if (!rctx->outbuf.buf) {
ret = ENOMEM; ret = -ENOMEM;
goto outbuf_err; goto outbuf_err;
} }