summaryrefslogtreecommitdiff
path: root/drivers/media/platform/qcom
diff options
context:
space:
mode:
authorDinghao Liu <dinghao.liu@zju.edu.cn>2020-05-21 15:06:21 +0300
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-06-23 14:19:59 +0300
commit606578801afe6ec8bb03f5d494a4bae49a684ef3 (patch)
tree48331ef1ec6955e6b07398968c08e0eef622e7ed /drivers/media/platform/qcom
parentcf7b1c794d2f2362610143375b4156111e35aed5 (diff)
downloadlinux-606578801afe6ec8bb03f5d494a4bae49a684ef3.tar.xz
media: camss: ispif: 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/qcom')
-rw-r--r--drivers/media/platform/qcom/camss/camss-ispif.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/platform/qcom/camss/camss-ispif.c b/drivers/media/platform/qcom/camss/camss-ispif.c
index 1f33b4eb198c..5722e971b184 100644
--- a/drivers/media/platform/qcom/camss/camss-ispif.c
+++ b/drivers/media/platform/qcom/camss/camss-ispif.c
@@ -344,8 +344,10 @@ static int ispif_set_power(struct v4l2_subdev *sd, int on)
}
ret = pm_runtime_get_sync(dev);
- if (ret < 0)
+ if (ret < 0) {
+ pm_runtime_put_sync(dev);
goto exit;
+ }
ret = camss_enable_clocks(ispif->nclocks, ispif->clock, dev);
if (ret < 0) {