Skip to content

Commit

Permalink
media: camss: ispif: Fix runtime PM imbalance on error
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 cf7b1c7 commit 6065788
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/media/platform/qcom/camss/camss-ispif.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6065788

Please sign in to comment.