From 97215cbd1bc3cc32a2a1b3a94b003c3cbcf95683 Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Fri, 13 Mar 2009 06:08:20 -0300 Subject: [PATCH] V4L/DVB (11029): video: use videobuf_waiton() in sh_mobile_ceu free_buffer() Make sure videobuf_waiton() is used before freeing a buffer. Without this fix we may return the buffer to the allocator before the bus mastering operation is finished. Reported-by: Matthieu CASTET Tested-by: Kuninori Morimoto Signed-off-by: Magnus Damm Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/sh_mobile_ceu_camera.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/video/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c index 55a5eae77bab..b5e37a530c62 100644 --- a/drivers/media/video/sh_mobile_ceu_camera.c +++ b/drivers/media/video/sh_mobile_ceu_camera.c @@ -174,6 +174,7 @@ static void free_buffer(struct videobuf_queue *vq, if (in_interrupt()) BUG(); + videobuf_waiton(&buf->vb, 0, 0); videobuf_dma_contig_free(vq, &buf->vb); dev_dbg(&icd->dev, "%s freed\n", __func__); buf->vb.state = VIDEOBUF_NEEDS_INIT; -- 2.39.5