Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 65768
b: refs/heads/master
c: 8beb058
h: refs/heads/master
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Oct 10, 2007
1 parent ec8b389 commit 3316d6a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 25e3f8f40ecf61b87a4b6476ea6d00cb5b74628c
refs/heads/master: 8beb058f1ecde7bc0554d18ce1baa18b5dfb02d3
12 changes: 7 additions & 5 deletions trunk/drivers/media/video/ivtv/ivtv-udma.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ int ivtv_udma_fill_sg_list (struct ivtv_user_dma *dma, struct ivtv_dma_page_info
int i, offset;
unsigned long flags;

if (map_offset < 0)
return map_offset;

offset = dma_page->offset;

/* Fill SG Array with new values */
Expand All @@ -55,7 +58,7 @@ int ivtv_udma_fill_sg_list (struct ivtv_user_dma *dma, struct ivtv_dma_page_info
if (dma->bouncemap[map_offset] == NULL)
dma->bouncemap[map_offset] = alloc_page(GFP_KERNEL);
if (dma->bouncemap[map_offset] == NULL)
return -ENOMEM;
return -1;
local_irq_save(flags);
src = kmap_atomic(dma->map[map_offset], KM_BOUNCE_READ) + offset;
memcpy(page_address(dma->bouncemap[map_offset]) + offset, src, len);
Expand All @@ -69,7 +72,7 @@ int ivtv_udma_fill_sg_list (struct ivtv_user_dma *dma, struct ivtv_dma_page_info
offset = 0;
map_offset++;
}
return 0;
return map_offset;
}

void ivtv_udma_fill_sg_array (struct ivtv_user_dma *dma, u32 buffer_offset, u32 buffer_offset_2, u32 split) {
Expand Down Expand Up @@ -138,13 +141,12 @@ int ivtv_udma_setup(struct ivtv *itv, unsigned long ivtv_dest_addr,
dma->page_count = user_dma.page_count;

/* Fill SG List with new values */
err = ivtv_udma_fill_sg_list(dma, &user_dma, 0);
if (err) {
if (ivtv_udma_fill_sg_list(dma, &user_dma, 0) < 0) {
for (i = 0; i < dma->page_count; i++) {
put_page(dma->map[i]);
}
dma->page_count = 0;
return err;
return -ENOMEM;
}

/* Map SG List */
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/ivtv/ivtv-yuv.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static int ivtv_yuv_prep_user_dma(struct ivtv *itv, struct ivtv_user_dma *dma,
}

/* Fill & map SG List */
if (ivtv_udma_fill_sg_list (dma, &uv_dma, ivtv_udma_fill_sg_list (dma, &y_dma, 0))) {
if (ivtv_udma_fill_sg_list (dma, &uv_dma, ivtv_udma_fill_sg_list (dma, &y_dma, 0)) < 0) {
IVTV_DEBUG_WARN("could not allocate bounce buffers for highmem userspace buffers\n");
for (i = 0; i < dma->page_count; i++) {
put_page(dma->map[i]);
Expand Down

0 comments on commit 3316d6a

Please sign in to comment.