Skip to content

Commit b07e5b0

Browse files
Phil Elwellpopcornmix
Phil Elwell
authored andcommitted
vchiq_arm: Sort out the vmalloc case
See: #1055
1 parent d88907f commit b07e5b0

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
@@ -395,21 +395,21 @@ create_pagelist(char __user *buf, size_t count, unsigned short type,
395395
if (is_vmalloc_addr(buf)) {
396396
int dir = (type == PAGELIST_WRITE) ?
397397
DMA_TO_DEVICE : DMA_FROM_DEVICE;
398-
unsigned long length = pagelist->length;
399-
unsigned int offset = pagelist->offset;
398+
unsigned long length = count;
399+
unsigned int off = offset;
400400

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

407407
if (bytes > length)
408408
bytes = length;
409409
pages[actual_pages] = pg;
410-
dmac_map_area(page_address(pg) + offset, bytes, dir);
410+
dmac_map_area(page_address(pg) + off, bytes, dir);
411411
length -= bytes;
412-
offset = 0;
412+
off = 0;
413413
}
414414
*need_release = 0; /* do not try and release vmalloc pages */
415415
} else {

0 commit comments

Comments
 (0)