diff options
Diffstat (limited to 'arch/x86/mm/gup.c')
-rw-r--r-- | arch/x86/mm/gup.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/x86/mm/gup.c b/arch/x86/mm/gup.c index 3085f25b4355..007bb06c7504 100644 --- a/arch/x86/mm/gup.c +++ b/arch/x86/mm/gup.c | |||
@@ -223,14 +223,17 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write, | |||
223 | struct page **pages) | 223 | struct page **pages) |
224 | { | 224 | { |
225 | struct mm_struct *mm = current->mm; | 225 | struct mm_struct *mm = current->mm; |
226 | unsigned long end = start + (nr_pages << PAGE_SHIFT); | 226 | unsigned long addr, len, end; |
227 | unsigned long addr = start; | ||
228 | unsigned long next; | 227 | unsigned long next; |
229 | pgd_t *pgdp; | 228 | pgd_t *pgdp; |
230 | int nr = 0; | 229 | int nr = 0; |
231 | 230 | ||
231 | start &= PAGE_MASK; | ||
232 | addr = start; | ||
233 | len = (unsigned long) nr_pages << PAGE_SHIFT; | ||
234 | end = start + len; | ||
232 | if (unlikely(!access_ok(write ? VERIFY_WRITE : VERIFY_READ, | 235 | if (unlikely(!access_ok(write ? VERIFY_WRITE : VERIFY_READ, |
233 | start, nr_pages*PAGE_SIZE))) | 236 | start, len))) |
234 | goto slow_irqon; | 237 | goto slow_irqon; |
235 | 238 | ||
236 | /* | 239 | /* |