diff options
author | Arnout Vandecappelle <arnout@mind.be> | 2010-03-17 18:53:04 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-19 11:58:40 -0400 |
commit | fc7f8fd42c2b934ac348995e0c530c917fc277d5 (patch) | |
tree | d83e4e80cbf38e3a64f1c6d32347e50535b0778a /drivers/media | |
parent | c06b062bea411f616b0890d502044c7871d5332f (diff) |
V4L/DVB: buf-dma-sg.c: don't assume nr_pages == sglen
videobuf_pages_to_sg() and videobuf_vmalloc_to_sg() happen to create
a scatterlist element for every page. However, this is not true for
bus addresses, so other functions shouldn't rely on the length of the
scatter list being equal to nr_pages.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/videobuf-dma-sg.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/video/videobuf-dma-sg.c b/drivers/media/video/videobuf-dma-sg.c index b49f1e23298a..8359e6badd36 100644 --- a/drivers/media/video/videobuf-dma-sg.c +++ b/drivers/media/video/videobuf-dma-sg.c | |||
@@ -286,7 +286,7 @@ int videobuf_dma_unmap(struct videobuf_queue *q, struct videobuf_dmabuf *dma) | |||
286 | if (!dma->sglen) | 286 | if (!dma->sglen) |
287 | return 0; | 287 | return 0; |
288 | 288 | ||
289 | dma_unmap_sg(q->dev, dma->sglist, dma->nr_pages, dma->direction); | 289 | dma_unmap_sg(q->dev, dma->sglist, dma->sglen, dma->direction); |
290 | 290 | ||
291 | vfree(dma->sglist); | 291 | vfree(dma->sglist); |
292 | dma->sglist = NULL; | 292 | dma->sglist = NULL; |
@@ -537,7 +537,7 @@ static int __videobuf_sync(struct videobuf_queue *q, | |||
537 | MAGIC_CHECK(mem->dma.magic, MAGIC_DMABUF); | 537 | MAGIC_CHECK(mem->dma.magic, MAGIC_DMABUF); |
538 | 538 | ||
539 | dma_sync_sg_for_cpu(q->dev, mem->dma.sglist, | 539 | dma_sync_sg_for_cpu(q->dev, mem->dma.sglist, |
540 | mem->dma.nr_pages, mem->dma.direction); | 540 | mem->dma.sglen, mem->dma.direction); |
541 | 541 | ||
542 | return 0; | 542 | return 0; |
543 | } | 543 | } |