summaryrefslogtreecommitdiff
path: root/drivers/crypto/hisilicon/sec2
diff options
context:
space:
mode:
authorWenkai Lin <linwenkai6@hisilicon.com>2023-09-15 12:13:29 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2023-09-20 08:15:54 +0300
commitce2cb2e1b8a27d929a0eaa042049912b0756efe0 (patch)
tree3128effe5d96f73f6f3c3893da6424b9d153f4cb /drivers/crypto/hisilicon/sec2
parent37b14f2dfa791fd485dbc536f8d1ffe8c6990290 (diff)
downloadlinux-ce2cb2e1b8a27d929a0eaa042049912b0756efe0.tar.xz
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 <linwenkai6@hisilicon.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/hisilicon/sec2')
-rw-r--r--drivers/crypto/hisilicon/sec2/sec_crypto.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.c b/drivers/crypto/hisilicon/sec2/sec_crypto.c
index 074e50ef512c..ed77711e809e 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;
}
}