|
@@ -23,7 +23,7 @@ static int __gup_benchmark_ioctl(unsigned int cmd,
|
|
|
struct page **pages;
|
|
|
|
|
|
nr_pages = gup->size / PAGE_SIZE;
|
|
|
- pages = kvmalloc(sizeof(void *) * nr_pages, GFP_KERNEL);
|
|
|
+ pages = kvzalloc(sizeof(void *) * nr_pages, GFP_KERNEL);
|
|
|
if (!pages)
|
|
|
return -ENOMEM;
|
|
|
|
|
@@ -41,6 +41,8 @@ static int __gup_benchmark_ioctl(unsigned int cmd,
|
|
|
}
|
|
|
|
|
|
nr = get_user_pages_fast(addr, nr, gup->flags & 1, pages + i);
|
|
|
+ if (nr <= 0)
|
|
|
+ break;
|
|
|
i += nr;
|
|
|
}
|
|
|
end_time = ktime_get();
|