summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorAditya Pakki <pakki001@umn.edu>2020-06-14 05:58:41 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-09-27 10:56:07 +0200
commit57cc666d36adc7b45e37ba4cd7bc4e44ec4c43d7 (patch)
tree2081b9a59dbc78ee665051dd5e9d4860041dffe5 /drivers/media
parentmedia: sti: Fix reference count leaks (diff)
downloadlinux-57cc666d36adc7b45e37ba4cd7bc4e44ec4c43d7.tar.xz
linux-57cc666d36adc7b45e37ba4cd7bc4e44ec4c43d7.zip
media: st-delta: Fix reference count leak in delta_run_work
delta_run_work() calls delta_get_sync() that increments the reference counter. In case of failure, decrement the reference count by calling delta_put_autosuspend(). Signed-off-by: Aditya Pakki <pakki001@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')
-rw-r--r--drivers/media/platform/sti/delta/delta-v4l2.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/platform/sti/delta/delta-v4l2.c b/drivers/media/platform/sti/delta/delta-v4l2.c
index 2503224eeee5..c691b3d81549 100644
--- a/drivers/media/platform/sti/delta/delta-v4l2.c
+++ b/drivers/media/platform/sti/delta/delta-v4l2.c
@@ -954,8 +954,10 @@ static void delta_run_work(struct work_struct *work)
/* enable the hardware */
if (!dec->pm) {
ret = delta_get_sync(ctx);
- if (ret)
+ if (ret) {
+ delta_put_autosuspend(ctx);
goto err;
+ }
}
/* decode this access unit */