crypto: starfive - Skip dma setup for zeroed message

Skip dma setup and mapping for AES driver if plaintext is empty.

Signed-off-by: Jia Jie Ho <jiajie.ho@starfivetech.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Jia Jie Ho 2024-04-29 14:06:37 +08:00 committed by Herbert Xu
parent 6117af8636
commit 3d12d90efa

View File

@ -590,12 +590,16 @@ static int starfive_aes_do_one_req(struct crypto_engine *engine, void *areq)
if (ret)
return ret;
if (!cryp->total_in)
goto finish_req;
starfive_aes_dma_init(cryp);
ret = starfive_aes_map_sg(cryp, rctx->in_sg, rctx->out_sg);
if (ret)
return ret;
finish_req:
starfive_aes_finish_req(ctx);
return 0;