From: Jia Jie Ho Date: Mon, 29 Apr 2024 06:06:37 +0000 (+0800) Subject: crypto: starfive - Skip dma setup for zeroed message X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3d12d90efadf689b05280ebbb3fca870298d218f;p=users%2Fhch%2Fblock.git 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 Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/starfive/jh7110-aes.c b/drivers/crypto/starfive/jh7110-aes.c index 72b7d46150d5..9d6e2f936f03 100644 --- a/drivers/crypto/starfive/jh7110-aes.c +++ b/drivers/crypto/starfive/jh7110-aes.c @@ -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;