From: <yanjiang.jin@windriver.com>
To: <herbert@gondor.apana.org.au>, <davem@davemloft.net>
Cc: <horia.geanta@freescale.com>, <kim.phillips@freescale.com>,
<ruchika.gupta@freescale.com>, <cristian.stoica@freescale.com>,
<NiteshNarayanLal@freescale.com>, <jinyanjiang@gmail.com>,
<linux-kernel@vger.kernel.org>, <linux-crypto@vger.kernel.org>
Subject: [PATCH 3/4] crypto: caamhash: add two missed dma_mapping_error
Date: Sat, 28 Feb 2015 14:00:33 +0800 [thread overview]
Message-ID: <1425103234-31129-3-git-send-email-yanjiang.jin@windriver.com> (raw)
In-Reply-To: <1425103234-31129-1-git-send-email-yanjiang.jin@windriver.com>
From: Yanjiang Jin <yanjiang.jin@windriver.com>
Add two missed dma_mapping_error() after dma_map_single().
Signed-off-by: Yanjiang Jin <yanjiang.jin@windriver.com>
---
drivers/crypto/caam/caamhash.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c
index f347ab7..f6ad322 100644
--- a/drivers/crypto/caam/caamhash.c
+++ b/drivers/crypto/caam/caamhash.c
@@ -160,6 +160,10 @@ static inline dma_addr_t map_seq_out_ptr_result(u32 *desc, struct device *jrdev,
dma_addr_t dst_dma;
dst_dma = dma_map_single(jrdev, result, digestsize, DMA_FROM_DEVICE);
+ if (dma_mapping_error(jrdev, dst_dma)) {
+ dev_err(jrdev, "unable to map dst dma\n");
+ return -ENOMEM;
+ }
append_seq_out_ptr(desc, dst_dma, digestsize, 0);
return dst_dma;
@@ -173,6 +177,10 @@ static inline dma_addr_t buf_map_to_sec4_sg(struct device *jrdev,
dma_addr_t buf_dma;
buf_dma = dma_map_single(jrdev, buf, buflen, DMA_TO_DEVICE);
+ if (dma_mapping_error(jrdev, buf_dma)) {
+ dev_err(jrdev, "unable to map buf dma\n");
+ return 0;
+ }
dma_to_sec4_sg_one(sec4_sg, buf_dma, buflen, 0);
return buf_dma;
--
1.9.1
next prev parent reply other threads:[~2015-02-28 6:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-28 6:00 [PATCH 1/4] crypto: caam: fix some compile warnings yanjiang.jin
2015-02-28 6:00 ` [PATCH 2/4] crypto: caam_rng: fix rng_unmap_ctx's DMA_UNMAP size problem yanjiang.jin
2015-03-02 11:09 ` Horia Geantă
2015-02-28 6:00 ` yanjiang.jin [this message]
2015-03-02 11:53 ` [PATCH 3/4] crypto: caamhash: add two missed dma_mapping_error Horia Geantă
2015-03-03 6:57 ` yjin
2015-02-28 6:00 ` [PATCH 4/4] crypto: caamhash: replace kmalloc with kzalloc yanjiang.jin
2015-03-02 11:03 ` Horia Geantă
2015-03-03 6:54 ` yjin
2015-03-02 11:08 ` [PATCH 1/4] crypto: caam: fix some compile warnings Horia Geantă
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=1425103234-31129-3-git-send-email-yanjiang.jin@windriver.com \
--to=yanjiang.jin@windriver.com \
--cc=NiteshNarayanLal@freescale.com \
--cc=cristian.stoica@freescale.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=horia.geanta@freescale.com \
--cc=jinyanjiang@gmail.com \
--cc=kim.phillips@freescale.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ruchika.gupta@freescale.com \
/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
all inboxes | Powered by JetHome®