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>
This commit is contained in:
Aditya Pakki 2020-06-14 05:58:41 +02:00 коммит произвёл Mauro Carvalho Chehab
Родитель 6f4432bae9
Коммит 57cc666d36
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -954,9 +954,11 @@ 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 */
ret = call_dec_op(dec, decode, ctx, au);