[PATCH] media: qcom: iris: cancel sys error work on driver removal
From: Hungyu Lin
Date: Thu Jun 04 2026 - 01:47:59 EST
Cancel sys_error_handler before tearing down the driver.
The delayed work may still be pending when iris_remove()
runs. Since iris_core is allocated with devm_kzalloc(),
allowing the work to execute after driver removal could
result in accessing freed memory.
Fixes: fb583a214337 ("media: iris: introduce host firmware interface with necessary hooks")
Signed-off-by: Hungyu Lin <dennylin0707@xxxxxxxxx>
---
drivers/media/platform/qcom/iris/iris_probe.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/platform/qcom/iris/iris_probe.c
index ddaacda523ec..1a740542bc81 100644
--- a/drivers/media/platform/qcom/iris/iris_probe.c
+++ b/drivers/media/platform/qcom/iris/iris_probe.c
@@ -192,6 +192,8 @@ static void iris_remove(struct platform_device *pdev)
if (!core)
return;
+ cancel_delayed_work_sync(&core->sys_error_handler);
+
iris_core_deinit(core);
video_unregister_device(core->vdev_dec);
--
2.34.1