summaryrefslogtreecommitdiff
path: root/drivers/media/platform/exynos4-is
diff options
context:
space:
mode:
authorQiushi Wu <wu000273@umn.edu>2020-06-14 06:10:58 +0300
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-09-27 11:55:09 +0300
commitc47f7c779ef0458a58583f00c9ed71b7f5a4d0a2 (patch)
treec2e5587c5eb4034e21254a4b818b6e9a50aa0bc5 /drivers/media/platform/exynos4-is
parent64157b2cb1940449e7df2670e85781c690266588 (diff)
downloadlinux-c47f7c779ef0458a58583f00c9ed71b7f5a4d0a2.tar.xz
media: exynos4-is: Fix a reference count leak due to pm_runtime_get_sync
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 <wu000273@umn.edu> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/platform/exynos4-is')
-rw-r--r--drivers/media/platform/exynos4-is/media-dev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c
index 7d92793a8e74..e636c33e847b 100644
--- a/drivers/media/platform/exynos4-is/media-dev.c
+++ b/drivers/media/platform/exynos4-is/media-dev.c
@@ -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;