]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
media: st-delta: Fix reference count leak in delta_run_work
authorAditya Pakki <pakki001@umn.edu>
Sun, 14 Jun 2020 03:58:41 +0000 (05:58 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sun, 27 Sep 2020 08:56:07 +0000 (10:56 +0200)
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>
drivers/media/platform/sti/delta/delta-v4l2.c

index 2503224eeee5103e115e9650667dab63ab01549e..c691b3d81549d408a5b96ed41e7a53b45fe9a8c1 100644 (file)
@@ -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 */