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>
This commit is contained in:
Dinghao Liu 2020-05-21 14:06:21 +02:00 committed by Mauro Carvalho Chehab
parent cf7b1c794d
commit 606578801a

View File

@ -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) {