crypto: marvell/cesa - Avoid empty transfer descriptor
[ Upstream commit 1bafd82d9a40cf09c6c40f1c09cc35b7050b1a9f ]
The user may set req->src even if req->nbytes == 0. If there
is no data to hash from req->src, do not generate an empty TDMA
descriptor.
Fixes: db509a4533
("crypto: marvell/cesa - add TDMA support")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
5e9666ac8b
commit
3cf4d9cae4
@@ -663,7 +663,7 @@ static int mv_cesa_ahash_dma_req_init(struct ahash_request *req)
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto err_free_tdma;
|
goto err_free_tdma;
|
||||||
|
|
||||||
if (iter.src.sg) {
|
if (iter.base.len > iter.src.op_offset) {
|
||||||
/*
|
/*
|
||||||
* Add all the new data, inserting an operation block and
|
* Add all the new data, inserting an operation block and
|
||||||
* launch command between each full SRAM block-worth of
|
* launch command between each full SRAM block-worth of
|
||||||
|
Reference in New Issue
Block a user