[PATCH] media: exynos4-is: Fix runtime PM usage counter leak in fimc-isp

fengchenguang at kylinos.cn fengchenguang at kylinos.cn
Wed Sep 30 04:38:49 PDT 2026


From: Chenguang Feng <fengchenguang at kylinos.cn>

fimc_isp_subdev_s_power() increments the usage counter with
pm_runtime_resume_and_get() and releases it if fimc_is_start_firmware()
fails, but not when fimc_is_hw_initialize() fails further down: the
function then returns with the counter still held, and the device can
never runtime-suspend afterwards.

Call pm_runtime_put() on the fimc_is_hw_initialize() error path as
well, like the fimc_is_start_firmware() path already does.

Fixes: 9a761e436843f ("[media] exynos4-is: Add Exynos4x12 FIMC-IS driver")
Cc: stable at vger.kernel.org
Signed-off-by: Chenguang Feng <fengchenguang at kylinos.cn>
---
 drivers/media/platform/samsung/exynos4-is/fimc-isp.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-isp.c b/drivers/media/platform/samsung/exynos4-is/fimc-isp.c
index 896a1b0952ad..8d4efb552424 100644
--- a/drivers/media/platform/samsung/exynos4-is/fimc-isp.c
+++ b/drivers/media/platform/samsung/exynos4-is/fimc-isp.c
@@ -322,6 +322,11 @@ static int fimc_isp_subdev_s_power(struct v4l2_subdev *sd, int on)
 		set_bit(IS_ST_PWR_SUBIP_ON, &is->state);
 
 		ret = fimc_is_hw_initialize(is);
+		if (ret < 0) {
+			v4l2_err(sd, "hardware initialization failed\n");
+			pm_runtime_put(&is->pdev->dev);
+			return ret;
+		}
 	} else {
 		/* Close sensor */
 		if (!test_bit(IS_ST_PWR_ON, &is->state)) {
-- 
2.25.1




More information about the linux-arm-kernel mailing list