From: Robin Murphy <robin.murphy@arm.com>
To: Rosen Penev <rosenp@gmail.com>, linux-crypto@vger.kernel.org
Cc: Srujana Challa <schalla@marvell.com>,
Bharat Bhushan <bbhushan2@marvell.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
Boris Brezillon <bbrezillon@kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCHv2] crypto: cesa: check for sram_dma error
Date: Mon, 27 Jul 2026 13:37:24 +0100 [thread overview]
Message-ID: <ec551e71-272e-4ea5-851e-840849fb913e@arm.com> (raw)
In-Reply-To: <20260717225831.1085313-1-rosenp@gmail.com>
On 17/07/2026 11:58 pm, Rosen Penev wrote:
> dma_map_resource() might fail. In such a case, don't call
> dma_unmap_resource()
>
> Fixes: 37d728f76c41 ("crypto: marvell/cesa - Fix DMA API misuse")
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
> v2: use dma_mapping_error(). Fix Fixes tag.
> drivers/crypto/marvell/cesa/cesa.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/crypto/marvell/cesa/cesa.c b/drivers/crypto/marvell/cesa/cesa.c
> index 75d8ba23d9a2..92e977027c8a 100644
> --- a/drivers/crypto/marvell/cesa/cesa.c
> +++ b/drivers/crypto/marvell/cesa/cesa.c
> @@ -406,7 +406,8 @@ static void mv_cesa_put_sram(struct platform_device *pdev, int idx)
> if (engine->pool)
> gen_pool_free(engine->pool, (unsigned long)engine->sram_pool,
> cesa->sram_size);
> - else
> + else if (engine->sram &&
This is still not quite right if the
devm_platform_get_and_ioremap_resource() call fails, since engine->sram
will then be non-NULL (an ERR_PTR value), but engine->sram_dma is still
untouched, and dma_mapping_error(0) is (usually) false.
Thanks,
Robin.
> + !dma_mapping_error(cesa->dev, engine->sram_dma))
> dma_unmap_resource(cesa->dev, engine->sram_dma,
> cesa->sram_size, DMA_BIDIRECTIONAL, 0);
> }
prev parent reply other threads:[~2026-07-27 12:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-17 22:58 [PATCHv2] crypto: cesa: check for sram_dma error Rosen Penev
2026-07-27 0:25 ` Herbert Xu
2026-07-27 12:37 ` Robin Murphy [this message]
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=ec551e71-272e-4ea5-851e-840849fb913e@arm.com \
--to=robin.murphy@arm.com \
--cc=bbhushan2@marvell.com \
--cc=bbrezillon@kernel.org \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rosenp@gmail.com \
--cc=schalla@marvell.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;
as well as URLs for NNTP newsgroup(s).