From: Jack Wang <jinpu.wang@ionos.com>
To: linux-kernel@vger.kernel.org
Cc: Gilad Ben-Yossef <gilad@benyossef.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
linux-crypto@vger.kernel.org
Subject: [PATCH v1 12/19] crypto: ccree: Fix dma_map_sg error check
Date: Fri, 19 Aug 2022 08:07:54 +0200 [thread overview]
Message-ID: <20220819060801.10443-13-jinpu.wang@ionos.com> (raw)
In-Reply-To: <20220819060801.10443-1-jinpu.wang@ionos.com>
dma_map_sg return 0 on error, and dma_map_error is not supposed to use
here.
Cc: Gilad Ben-Yossef <gilad@benyossef.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: linux-crypto@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
---
drivers/crypto/ccree/cc_buffer_mgr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/ccree/cc_buffer_mgr.c b/drivers/crypto/ccree/cc_buffer_mgr.c
index 6140e4927322..9efd88f871d1 100644
--- a/drivers/crypto/ccree/cc_buffer_mgr.c
+++ b/drivers/crypto/ccree/cc_buffer_mgr.c
@@ -274,7 +274,7 @@ static int cc_map_sg(struct device *dev, struct scatterlist *sg,
}
ret = dma_map_sg(dev, sg, *nents, direction);
- if (dma_mapping_error(dev, ret)) {
+ if (!ret) {
*nents = 0;
dev_err(dev, "dma_map_sg() sg buffer failed %d\n", ret);
return -ENOMEM;
--
2.34.1
next prev parent reply other threads:[~2022-08-19 6:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220819060801.10443-1-jinpu.wang@ionos.com>
2022-08-19 6:07 ` [PATCH v1 07/19] crypto: gemin: Fix error check for dma_map_sg Jack Wang
2022-08-26 8:13 ` Linus Walleij
2022-08-26 11:06 ` Herbert Xu
2022-08-26 12:04 ` LABBE Corentin
2022-08-26 12:08 ` Jinpu Wang
2022-08-19 6:07 ` [PATCH v1 08/19] crypto: sahara: " Jack Wang
2022-08-19 6:07 ` [PATCH v1 09/19] crypto: qce: Fix dma_map_sg error check Jack Wang
2022-08-19 6:07 ` [PATCH v1 10/19] crypto: amlogic: " Jack Wang
2022-08-26 12:46 ` LABBE Corentin
2022-08-19 6:07 ` [PATCH v1 11/19] crypto: allwinner: " Jack Wang
2022-08-19 6:07 ` Jack Wang [this message]
2022-08-21 9:44 ` [PATCH v1 12/19] crypto: ccree: " Gilad Ben-Yossef
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220819060801.10443-13-jinpu.wang@ionos.com \
--to=jinpu.wang@ionos.com \
--cc=davem@davemloft.net \
--cc=gilad@benyossef.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox