Skip to content

Commit 3d12d90

Browse files
jiajiehoherbertx
authored andcommitted
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 <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 6117af8 commit 3d12d90

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/crypto/starfive/jh7110-aes.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,12 +590,16 @@ static int starfive_aes_do_one_req(struct crypto_engine *engine, void *areq)
590590
if (ret)
591591
return ret;
592592

593+
if (!cryp->total_in)
594+
goto finish_req;
595+
593596
starfive_aes_dma_init(cryp);
594597

595598
ret = starfive_aes_map_sg(cryp, rctx->in_sg, rctx->out_sg);
596599
if (ret)
597600
return ret;
598601

602+
finish_req:
599603
starfive_aes_finish_req(ctx);
600604

601605
return 0;

0 commit comments

Comments
 (0)