Skip to content

Commit 7790969

Browse files
dinghaoliumchehab
authored andcommitted
media: camss: vfe: 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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 6065788 commit 7790969

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/media/platform/qcom/camss/camss-vfe.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,12 +1265,12 @@ static int vfe_get(struct vfe_device *vfe)
12651265

12661266
ret = vfe_set_clock_rates(vfe);
12671267
if (ret < 0)
1268-
goto error_clocks;
1268+
goto error_pm_runtime_get;
12691269

12701270
ret = camss_enable_clocks(vfe->nclocks, vfe->clock,
12711271
vfe->camss->dev);
12721272
if (ret < 0)
1273-
goto error_clocks;
1273+
goto error_pm_runtime_get;
12741274

12751275
ret = vfe_reset(vfe);
12761276
if (ret < 0)
@@ -1282,7 +1282,7 @@ static int vfe_get(struct vfe_device *vfe)
12821282
} else {
12831283
ret = vfe_check_clock_rates(vfe);
12841284
if (ret < 0)
1285-
goto error_clocks;
1285+
goto error_pm_runtime_get;
12861286
}
12871287
vfe->power_count++;
12881288

@@ -1293,10 +1293,8 @@ static int vfe_get(struct vfe_device *vfe)
12931293
error_reset:
12941294
camss_disable_clocks(vfe->nclocks, vfe->clock);
12951295

1296-
error_clocks:
1297-
pm_runtime_put_sync(vfe->camss->dev);
1298-
12991296
error_pm_runtime_get:
1297+
pm_runtime_put_sync(vfe->camss->dev);
13001298
camss_pm_domain_off(vfe->camss, vfe->id);
13011299

13021300
error_pm_domain:

0 commit comments

Comments
 (0)