Skip to content

Commit

Permalink
media: st-delta: Fix reference count leak in delta_run_work
Browse files Browse the repository at this point in the history
[ Upstream commit 57cc666 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Aditya Pakki authored and gregkh committed Oct 29, 2020
1 parent fe8798e commit 236117a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/media/platform/sti/delta/delta-v4l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 236117a

Please sign in to comment.