From: Corentin Labbe <clabbe.montjoie@gmail.com>
To: Jia-Ju Bai <baijiaju1990@gmail.com>
Cc: herbert@gondor.apana.org.au, davem@davemloft.net,
mripard@kernel.org, wens@csie.org, jernej.skrabec@siol.net,
mchehab+huawei@kernel.org, corbet@lwn.net,
linux-crypto@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] crypto: allwinner: sun8i-ce: fix error return code in sun8i_ce_prng_generate()
Date: Tue, 9 Mar 2021 07:44:24 +0100 [thread overview]
Message-ID: <YEcZSJ4T/Z0M4VaU@Red> (raw)
In-Reply-To: <20210305015717.2908-1-baijiaju1990@gmail.com>
Le Thu, Mar 04, 2021 at 05:57:17PM -0800, Jia-Ju Bai a écrit :
> When dma_mapping_error() returns an error, no error return code of
> sun8i_ce_prng_generate() is assigned.
> To fix this bug, err is assigned with -EFAULT as error return code.
>
> Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
> ---
> drivers/crypto/allwinner/sun8i-ce/sun8i-ce-prng.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-prng.c b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-prng.c
> index cfde9ee4356b..cd1baee424a1 100644
> --- a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-prng.c
> +++ b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-prng.c
> @@ -99,6 +99,7 @@ int sun8i_ce_prng_generate(struct crypto_rng *tfm, const u8 *src,
> dma_iv = dma_map_single(ce->dev, ctx->seed, ctx->slen, DMA_TO_DEVICE);
> if (dma_mapping_error(ce->dev, dma_iv)) {
> dev_err(ce->dev, "Cannot DMA MAP IV\n");
> + err = -EFAULT;
> goto err_iv;
> }
>
> --
> 2.17.1
>
Hello
Tested-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Thanks
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-03-09 6:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-05 1:57 [PATCH] crypto: allwinner: sun8i-ce: fix error return code in sun8i_ce_prng_generate() Jia-Ju Bai
2021-03-09 6:44 ` Corentin Labbe [this message]
2021-03-12 13:13 ` 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=YEcZSJ4T/Z0M4VaU@Red \
--to=clabbe.montjoie@gmail.com \
--cc=baijiaju1990@gmail.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=jernej.skrabec@siol.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab+huawei@kernel.org \
--cc=mripard@kernel.org \
--cc=wens@csie.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;
as well as URLs for NNTP newsgroup(s).