浏览代码

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 <damm@igel.co.jp>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Magnus Damm 16 年之前
父节点
当前提交
d4db588ccc
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/media/video/videobuf-dma-contig.c

+ 1 - 1
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)