From: Rosen Penev <rosenp@gmail.com>
To: 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>,
Robin Murphy <robin.murphy@arm.com>,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] crypto: cesa: check for sram_dma NULL
Date: Sun, 12 Jul 2026 22:07:40 -0700 [thread overview]
Message-ID: <20260713050740.3687230-1-rosenp@gmail.com> (raw)
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>
---
drivers/crypto/marvell/cesa/cesa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/marvell/cesa/cesa.c b/drivers/crypto/marvell/cesa/cesa.c
index 57c9295be711..bcbb909c48d8 100644
--- a/drivers/crypto/marvell/cesa/cesa.c
+++ b/drivers/crypto/marvell/cesa/cesa.c
@@ -406,7 +406,7 @@ 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_dma)
dma_unmap_resource(cesa->dev, engine->sram_dma,
cesa->sram_size, DMA_BIDIRECTIONAL, 0);
}
--
2.55.0
next reply other threads:[~2026-07-13 5:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-13 5:07 Rosen Penev [this message]
2026-07-13 11:58 ` Robin Murphy
2026-07-13 19:50 ` Rosen Penev
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=20260713050740.3687230-1-rosenp@gmail.com \
--to=rosenp@gmail.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=robin.murphy@arm.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
Powered by JetHome