mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
crypto: tegra: finalize crypto req on error
Call the crypto finalize function before exiting *do_one_req() functions. This allows the driver to take up further requests even if the previous one fails. Bug 4883011 Signed-off-by: Akhil R <akhilrajeev@nvidia.com> Change-Id: I36ee3548159e96432e7d15b93f7ef688022dbc87 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3328438 Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
@@ -1510,9 +1510,10 @@ static int tegra_gcm_do_one_req(struct crypto_engine *engine, void *areq)
|
||||
rctx->inbuf.size = rctx->assoclen + rctx->authsize + rctx->cryptlen;
|
||||
rctx->inbuf.buf = dma_alloc_coherent(ctx->se->dev, rctx->inbuf.size,
|
||||
&rctx->inbuf.addr, GFP_KERNEL);
|
||||
if (!rctx->inbuf.buf)
|
||||
return -ENOMEM;
|
||||
|
||||
if (!rctx->inbuf.buf) {
|
||||
ret = -ENOMEM;
|
||||
goto out_finalize;
|
||||
}
|
||||
|
||||
rctx->outbuf.size = rctx->assoclen + rctx->authsize + rctx->cryptlen;
|
||||
rctx->outbuf.buf = dma_alloc_coherent(ctx->se->dev, rctx->outbuf.size,
|
||||
@@ -1560,6 +1561,7 @@ outbuf_err:
|
||||
dma_free_coherent(ctx->se->dev, rctx->inbuf.size,
|
||||
rctx->inbuf.buf, rctx->inbuf.addr);
|
||||
|
||||
out_finalize:
|
||||
/* Finalize the request if there are no errors */
|
||||
crypto_finalize_aead_request(ctx->se->engine, req, ret);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user