]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: vim2m: use cancel_delayed_work_sync instead of flush_schedule_work
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 7 Nov 2018 14:04:54 +0000 (09:04 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jan 2019 16:46:02 +0000 (17:46 +0100)
commit 52117be68b82ee05c96da0a7beec319906ccf6cc upstream.

The use of flush_schedule_work() made no sense and caused a syzkaller error.
Replace with the correct cancel_delayed_work_sync().

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reported-by: syzbot+69780d144754b8071f4b@syzkaller.appspotmail.com
Cc: <stable@vger.kernel.org> # for v4.20 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/vim2m.c

index d82db738f174ef048d663d366b4950cd732c2b43..f938a2c54314c46140c3f85b76b19e3dde67776f 100644 (file)
@@ -805,10 +805,11 @@ static int vim2m_start_streaming(struct vb2_queue *q, unsigned count)
 static void vim2m_stop_streaming(struct vb2_queue *q)
 {
        struct vim2m_ctx *ctx = vb2_get_drv_priv(q);
+       struct vim2m_dev *dev = ctx->dev;
        struct vb2_v4l2_buffer *vbuf;
        unsigned long flags;
 
-       flush_scheduled_work();
+       cancel_delayed_work_sync(&dev->work_run);
        for (;;) {
                if (V4L2_TYPE_IS_OUTPUT(q->type))
                        vbuf = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx);