From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Guangshuo Li <lgs201920130244@gmail.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.15.y 6/6] crypto: omap-des - fix crypto engine cleanup
Date: Tue, 10 Nov 2026 07:22:36 -0500 [thread overview]
Message-ID: <20261110122229.1112116-6-sashal@kernel.org> (raw)
In-Reply-To: <20261110122229.1112116-1-sashal@kernel.org>
From: Guangshuo Li <lgs201920130244@gmail.com>
[ Upstream commit 5d69ed4cd4f9c68ff9a6ebb2e8a1079223a4ec6e ]
omap_des_probe() allocates and starts a crypto engine, but the remove
path does not call the matching crypto_engine_exit(). The probe failure
path already performs this cleanup.
crypto_engine_alloc_init() creates a kthread worker for processing
requests. Without crypto_engine_exit() during driver removal, the
worker is left running after the device is removed.
Call crypto_engine_exit() after unregistering the algorithms and before
tearing down the remaining request handling resources. This stops the
engine and destroys its worker.
This issue was found by manual code inspection.
Fixes: f1b77aaca85a ("crypto: omap-des - Integrate with the crypto engine framework")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/omap-des.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/crypto/omap-des.c b/drivers/crypto/omap-des.c
index 84e3e69a406fd..ad09560c9f4f4 100644
--- a/drivers/crypto/omap-des.c
+++ b/drivers/crypto/omap-des.c
@@ -1098,6 +1098,8 @@ static int omap_des_remove(struct platform_device *pdev)
crypto_engine_unregister_skcipher(
&dd->pdata->algs_info[i].algs_list[j]);
+ crypto_engine_exit(dd->engine);
+
cancel_work_sync(&dd->done_task);
omap_des_dma_cleanup(dd);
pm_runtime_disable(dd->dev);
--
2.53.0
prev parent reply other threads:[~2026-11-10 12:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-07 10:59 FAILED: patch "[PATCH] crypto: omap-des - fix crypto engine cleanup" failed to apply to 5.15-stable tree Sasha Levin
2026-11-10 12:22 ` [PATCH 5.15.y 1/6] crypto: omap - increase priority of DES/3DES Sasha Levin
2026-11-10 12:22 ` [PATCH 5.15.y 2/6] crypto: omap - Remove prepare/unprepare request Sasha Levin
2026-11-10 12:22 ` [PATCH 5.15.y 3/6] crypto: omap - Include internal/engine.h Sasha Levin
2026-11-10 12:22 ` [PATCH 5.15.y 4/6] crypto: omap - Use new crypto_engine_op interface Sasha Levin
2026-11-10 12:22 ` [PATCH 5.15.y 5/6] crypto: omap - convert from tasklet to BH workqueue Sasha Levin
2026-11-10 12:22 ` Sasha Levin [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=20261110122229.1112116-6-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=lgs201920130244@gmail.com \
--cc=stable@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