From: Wenkai Lin Date: Fri, 15 Sep 2023 09:13:29 +0000 (+0800) Subject: crypto: hisilicon/sec - fix for sgl unmmap problem X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=ce2cb2e1b8a27d929a0eaa042049912b0756efe0;p=linux.git crypto: hisilicon/sec - fix for sgl unmmap problem When sec_aead_mac_init returns an error code, sec_cipher_map will exit abnormally, the hardware sgl should be unmmaped. Signed-off-by: Wenkai Lin Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.c b/drivers/crypto/hisilicon/sec2/sec_crypto.c index 074e50ef512c1..ed77711e809e6 100644 --- a/drivers/crypto/hisilicon/sec2/sec_crypto.c +++ b/drivers/crypto/hisilicon/sec2/sec_crypto.c @@ -1011,6 +1011,7 @@ static int sec_cipher_map(struct sec_ctx *ctx, struct sec_req *req, ret = sec_aead_mac_init(a_req); if (unlikely(ret)) { dev_err(dev, "fail to init mac data for ICV!\n"); + hisi_acc_sg_buf_unmap(dev, src, req->in); return ret; } }