From: Gary R Hook <gary.hook@amd.com>
To: Pan Bian <bianpan2016@163.com>,
"Lendacky, Thomas" <Thomas.Lendacky@amd.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>
Cc: "linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: crypto: ccp: use dma_mapping_error to check map error
Date: Tue, 8 Aug 2017 10:26:50 -0500 [thread overview]
Message-ID: <d51e705d-bfc9-997b-957a-416da2d3782a@amd.com> (raw)
In-Reply-To: <1502199767-2578-1-git-send-email-bianpan2016@163.com>
On 08/08/2017 08:42 AM, Pan Bian wrote:
> The return value of dma_map_single() should be checked by
> dma_mapping_error(). However, in function ccp_init_dm_workarea(), its
> return value is checked against NULL, which could result in failures.
>
> Signed-off-by: Pan Bian <bianpan2016@163.com>
Acked-by: Gary R Hook <gary.hook@amd.com>
> ---
> drivers/crypto/ccp/ccp-ops.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/crypto/ccp/ccp-ops.c b/drivers/crypto/ccp/ccp-ops.c
> index c0dfdac..ca83d19 100644
> --- a/drivers/crypto/ccp/ccp-ops.c
> +++ b/drivers/crypto/ccp/ccp-ops.c
> @@ -168,7 +168,7 @@ static int ccp_init_dm_workarea(struct ccp_dm_workarea *wa,
>
> wa->dma.address = dma_map_single(wa->dev, wa->address, len,
> dir);
> - if (!wa->dma.address)
> + if (dma_mapping_error(wa->dev, wa->dma.address))
> return -ENOMEM;
>
> wa->dma.length = len;
>
next prev parent reply other threads:[~2017-08-08 15:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-08 13:42 Pan Bian
2017-08-08 15:26 ` Gary R Hook [this message]
2017-08-17 9:00 ` Herbert Xu
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=d51e705d-bfc9-997b-957a-416da2d3782a@amd.com \
--to=gary.hook@amd.com \
--cc=Thomas.Lendacky@amd.com \
--cc=bianpan2016@163.com \
--cc=davem@davemloft.net \
--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
all inboxes | Powered by JetHome®