V4L/DVB (10304): buf-dma-contig: fix USERPTR free handling
authorMagnus Damm <damm@igel.co.jp>
Wed, 10 Dec 2008 04:54:32 +0000 (01:54 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 30 Mar 2009 15:42:27 +0000 (12:42 -0300)
This patch fixes a free-without-alloc bug for V4L2_MEMORY_USERPTR
video buffers.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/videobuf-dma-contig.c

index 31944b11e6ea409fa454eb1f02a99f7e761f2e4e..6109fb5f34e2bb9b54ae7a1a289c8144c9ea86f3 100644 (file)
@@ -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)