From: Magnus Damm Date: Fri, 13 Mar 2009 09:08:20 +0000 (-0300) Subject: V4L/DVB (11029): video: use videobuf_waiton() in sh_mobile_ceu free_buffer() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=97215cbd1bc3cc32a2a1b3a94b003c3cbcf95683;p=linux-beck.git 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 --- 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;