summaryrefslogtreecommitdiff
path: root/drivers/media/platform/exynos4-is
diff options
context:
space:
mode:
authorDinghao Liu <dinghao.liu@zju.edu.cn>2020-05-21 13:22:04 +0300
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-06-23 14:18:44 +0300
commite40a8770fd147e7c0d5bd8c327d88090480242f2 (patch)
treea1a1b1ceb20a85da6ab3b1fe0e0b7694c08f7b83 /drivers/media/platform/exynos4-is
parent157282a5c6273976b31cf4ba4b1c46663f6519d1 (diff)
downloadlinux-e40a8770fd147e7c0d5bd8c327d88090480242f2.tar.xz
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@zju.edu.cn> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/platform/exynos4-is')
-rw-r--r--drivers/media/platform/exynos4-is/fimc-capture.c4
1 files changed, 3 insertions, 1 deletions
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) {