diff mbox series

vim2m: use cancel_delayed_work_sync instead of flush_schedule_work

Message ID ff77abc3-7c15-8319-f500-a48db4f4bd5d@xs4all.nl (mailing list archive)
State New, archived
Headers show
Series vim2m: use cancel_delayed_work_sync instead of flush_schedule_work | expand

Commit Message

Hans Verkuil Nov. 7, 2018, 2:04 p.m. UTC
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 <hans.verkuil>
Reported-by: syzbot+69780d144754b8071f4b@syzkaller.appspotmail.com
---

Comments

Hans Verkuil Nov. 22, 2018, 9:30 p.m. UTC | #1
On 11/07/2018 03:04 PM, Hans Verkuil wrote:
> 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 <hans.verkuil>

Mistyped that SoB, this should of course be:

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

Regards,

	Hans

> Reported-by: syzbot+69780d144754b8071f4b@syzkaller.appspotmail.com
> ---
> diff --git a/drivers/media/platform/vim2m.c b/drivers/media/platform/vim2m.c
> index d82db738f174..f938a2c54314 100644
> --- a/drivers/media/platform/vim2m.c
> +++ b/drivers/media/platform/vim2m.c
> @@ -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);
>
diff mbox series

Patch

diff --git a/drivers/media/platform/vim2m.c b/drivers/media/platform/vim2m.c
index d82db738f174..f938a2c54314 100644
--- a/drivers/media/platform/vim2m.c
+++ b/drivers/media/platform/vim2m.c
@@ -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);