summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDinghao Liu <dinghao.liu@zju.edu.cn>2020-05-23 09:36:39 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-06-23 13:19:43 +0200
commitcf7b1c794d2f2362610143375b4156111e35aed5 (patch)
treee19bbacfa6d27ff1877f2294c489a69c053fdde8
parent90361693ad8d13a4311fc671903dcedd6ec06940 (diff)
media: camss: csid: Fix runtime PM imbalance in csid_set_power
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>
-rw-r--r--drivers/media/platform/qcom/camss/camss-csid.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media/platform/qcom/camss/camss-csid.c
index a5ae85674ffb..8a247b6f5550 100644
--- a/drivers/media/platform/qcom/camss/camss-csid.c
+++ b/drivers/media/platform/qcom/camss/camss-csid.c
@@ -562,8 +562,10 @@ static int csid_set_power(struct v4l2_subdev *sd, int on)
u32 hw_version;
ret = pm_runtime_get_sync(dev);
- if (ret < 0)
+ if (ret < 0) {
+ pm_runtime_put_sync(dev);
return ret;
+ }
ret = regulator_enable(csid->vdda);
if (ret < 0) {