Skip to content

Commit

Permalink
V4L/DVB (10304): buf-dma-contig: fix USERPTR free handling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Magnus Damm authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent 87e3495 commit d4db588
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/video/videobuf-dma-contig.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d4db588

Please sign in to comment.