Skip to content

Commit 042bc60

Browse files
author
Phil Elwell
committed
vchiq_arm: Sort out the vmalloc case
See: #1055
1 parent 0dd4dae commit 042bc60

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -394,21 +394,21 @@ create_pagelist(char __user *buf, size_t count, unsigned short type,
394394
if (is_vmalloc_addr(buf)) {
395395
int dir = (type == PAGELIST_WRITE) ?
396396
DMA_TO_DEVICE : DMA_FROM_DEVICE;
397-
unsigned long length = pagelist->length;
398-
unsigned int offset = pagelist->offset;
397+
unsigned long length = count;
398+
unsigned int off = offset;
399399

400400
for (actual_pages = 0; actual_pages < num_pages;
401401
actual_pages++) {
402402
struct page *pg = vmalloc_to_page(buf + (actual_pages *
403403
PAGE_SIZE));
404-
size_t bytes = PAGE_SIZE - offset;
404+
size_t bytes = PAGE_SIZE - off;
405405

406406
if (bytes > length)
407407
bytes = length;
408408
pages[actual_pages] = pg;
409-
dmac_map_area(page_address(pg) + offset, bytes, dir);
409+
dmac_map_area(page_address(pg) + off, bytes, dir);
410410
length -= bytes;
411-
offset = 0;
411+
off = 0;
412412
}
413413
*need_release = 0; /* do not try and release vmalloc pages */
414414
} else {

0 commit comments

Comments
 (0)