summaryrefslogtreecommitdiff
path: root/mm/gup.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/gup.c')
-rw-r--r--mm/gup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/gup.c b/mm/gup.c
index d585aa06afb2..ad120f470735 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -261,8 +261,8 @@ static inline struct page *compound_range_next(struct page *start,
next = nth_page(start, i);
page = compound_head(next);
if (PageHead(page))
- nr = min_t(unsigned int,
- page + compound_nr(page) - next, npages - i);
+ nr = min_t(unsigned int, npages - i,
+ compound_nr(page) - page_nth(page, next));
*ntails = nr;
return page;