Skip to content

Commit

Permalink
media: camss: csid: Fix runtime PM imbalance in csid_set_power
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
dinghaoliu authored and mchehab committed Jun 23, 2020
1 parent 9036169 commit cf7b1c7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/media/platform/qcom/camss/camss-csid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit cf7b1c7

Please sign in to comment.