Skip to content

Commit

Permalink
media: exynos4-is: Fix a reference count leak due to pm_runtime_get_sync
Browse files Browse the repository at this point in the history
On calling pm_runtime_get_sync() the reference count of the device
is incremented. In case of failure, decrement the
reference count before returning the error.

Signed-off-by: Qiushi Wu <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
QiushiWu authored and mchehab committed Sep 27, 2020
1 parent 64157b2 commit c47f7c7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/media/platform/exynos4-is/media-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,10 @@ static int fimc_md_register_sensor_entities(struct fimc_md *fmd)
return -ENXIO;

ret = pm_runtime_get_sync(fmd->pmf);
if (ret < 0)
if (ret < 0) {
pm_runtime_put(fmd->pmf);
return ret;
}

fmd->num_sensors = 0;

Expand Down

0 comments on commit c47f7c7

Please sign in to comment.