Skip to content

Commit

Permalink
[media] vb2: Fix dma_dir setting for dma-contig mem type
Browse files Browse the repository at this point in the history
The last argument of vb2_dc_get_user_pages() is of type enum
dma_data_direction, but the caller, vb2_dc_get_userptr() passes a value
which is the result of comparison dma_dir == DMA_FROM_DEVICE. This results
in the write parameter to get_user_pages() being zero in all cases, i.e.
that the caller has no intent to write there.

This was broken by patch "vb2: replace 'write' by 'dma_dir'".

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: stable@vger.kernel.org  # for v3.19
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  • Loading branch information
Sakari Ailus authored and Mauro Carvalho Chehab committed Apr 2, 2015
1 parent a0f10c1 commit 4879785
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/media/v4l2-core/videobuf2-dma-contig.c
Original file line number Diff line number Diff line change
@@ -632,8 +632,7 @@ static void *vb2_dc_get_userptr(void *alloc_ctx, unsigned long vaddr,
}

/* extract page list from userspace mapping */
ret = vb2_dc_get_user_pages(start, pages, n_pages, vma,
dma_dir == DMA_FROM_DEVICE);
ret = vb2_dc_get_user_pages(start, pages, n_pages, vma, dma_dir);
if (ret) {
unsigned long pfn;
if (vb2_dc_get_user_pfn(start, n_pages, vma, &pfn) == 0) {

0 comments on commit 4879785

Please sign in to comment.