media: camss: ispif: Fix runtime PM imbalance on error
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Thu, 21 May 2020 12:06:21 +0000 (14:06 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 23 Jun 2020 11:19:59 +0000 (13:19 +0200)
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>
drivers/media/platform/qcom/camss/camss-ispif.c

index 1f33b4eb198cc0c3085239afbd52aee428bf63a4..5722e971b1848eaf68ddc650ba19c93f7cfa0ffc 100644 (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) {