diff mbox series

hwrng: cctrng: Add cancel_work_sync before module remove

Message ID d71e0bcee781ebe12697df94083f16d651fb30c0.1732786634.git.xiaopei01@kylinos.cn
State New
Headers show
Series hwrng: cctrng: Add cancel_work_sync before module remove | expand

Commit Message

Pei Xiao Nov. 28, 2024, 9:39 a.m. UTC
Be ensured that the work is canceled before proceeding with
the cleanup in cc_trng_pm_fini.

Fixes: a583ed310bb6 ("hwrng: cctrng - introduce Arm CryptoCell driver")
Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
---
 drivers/char/hw_random/cctrng.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/char/hw_random/cctrng.c b/drivers/char/hw_random/cctrng.c
index 4db198849695..fd1ee3687782 100644
--- a/drivers/char/hw_random/cctrng.c
+++ b/drivers/char/hw_random/cctrng.c
@@ -127,6 +127,8 @@  static void cc_trng_pm_fini(struct cctrng_drvdata *drvdata)
 {
 	struct device *dev = &(drvdata->pdev->dev);
 
+	cancel_work_sync(&drvdata->compwork);
+	cancel_work_sync(&drvdata->startwork);
 	pm_runtime_disable(dev);
 }