From: Magnus Damm Date: Wed, 10 Dec 2008 04:54:32 +0000 (-0300) Subject: V4L/DVB (10304): buf-dma-contig: fix USERPTR free handling X-Git-Tag: v2.6.30-rc1~621^2~664 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d4db588ccc738528601947d57fd398bb3f55cd31;p=platform%2Fkernel%2Flinux-exynos.git V4L/DVB (10304): buf-dma-contig: fix USERPTR free handling This patch fixes a free-without-alloc bug for V4L2_MEMORY_USERPTR video buffers. Signed-off-by: Magnus Damm Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/videobuf-dma-contig.c b/drivers/media/video/videobuf-dma-contig.c index 31944b1..6109fb5 100644 --- a/drivers/media/video/videobuf-dma-contig.c +++ b/drivers/media/video/videobuf-dma-contig.c @@ -400,7 +400,7 @@ void videobuf_dma_contig_free(struct videobuf_queue *q, So, it should free memory only if the memory were allocated for read() operation. */ - if ((buf->memory != V4L2_MEMORY_USERPTR) || !buf->baddr) + if ((buf->memory != V4L2_MEMORY_USERPTR) || buf->baddr) return; if (!mem)