[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20200521102205.16604-1-dinghao.liu@zju.edu.cn>
Date: Thu, 21 May 2020 18:22:04 +0800
From: Dinghao Liu <dinghao.liu@....edu.cn>
To: dinghao.liu@....edu.cn, kjlu@....edu
Cc: Kyungmin Park <kyungmin.park@...sung.com>,
Sylwester Nawrocki <s.nawrocki@...sung.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Kukjin Kim <kgene@...nel.org>,
Krzysztof Kozlowski <krzk@...nel.org>,
linux-media@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] media: fimc-capture: Fix runtime PM imbalance on error
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu <dinghao.liu@....edu.cn>
---
drivers/media/platform/exynos4-is/fimc-capture.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/exynos4-is/fimc-capture.c b/drivers/media/platform/exynos4-is/fimc-capture.c
index 705f182330ca..dd33b888971f 100644
--- a/drivers/media/platform/exynos4-is/fimc-capture.c
+++ b/drivers/media/platform/exynos4-is/fimc-capture.c
@@ -478,8 +478,10 @@ static int fimc_capture_open(struct file *file)
set_bit(ST_CAPT_BUSY, &fimc->state);
ret = pm_runtime_get_sync(&fimc->pdev->dev);
- if (ret < 0)
+ if (ret < 0) {
+ pm_runtime_put_sync(&fimc->pdev->dev);
goto unlock;
+ }
ret = v4l2_fh_open(file);
if (ret) {
--
2.17.1
Powered by blists - more mailing lists