[PATCH 3/3] crypto: marvell/cesa - Free hash padding when queueing fails
From: Haoxiang Li
Date: Wed Nov 18 2026 - 02:57:13 EST
A final hash request rejected by the queue runs generic request cleanup,
which releases the DMA cache and TDMA descriptors but leaves padding
allocated. The request will not reach completion cleanup after rejection.
Release padding before generic cleanup, while the TDMA chain still
identifies the request as a DMA request. Keep resources allocated for
requests accepted normally or as backlog.
Fixes: db509a45339f ("crypto: marvell/cesa - add TDMA support")
Signed-off-by: Haoxiang Li <haoxiang_li2024@xxxxxxx>
---
drivers/crypto/marvell/cesa/hash.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/crypto/marvell/cesa/hash.c b/drivers/crypto/marvell/cesa/hash.c
index f698d3df535b..d2fe96d865bd 100644
--- a/drivers/crypto/marvell/cesa/hash.c
+++ b/drivers/crypto/marvell/cesa/hash.c
@@ -796,8 +796,11 @@ static int mv_cesa_ahash_queue_req(struct ahash_request *req)
ret = mv_cesa_queue_req(&req->base, &creq->base);
- if (mv_cesa_req_needs_cleanup(&req->base, ret))
+ if (mv_cesa_req_needs_cleanup(&req->base, ret)) {
+ if (creq->last_req)
+ mv_cesa_ahash_last_cleanup(req);
mv_cesa_ahash_cleanup(req);
+ }
return ret;
}
--
2.25.1