diff --git a/mm/gup.c b/mm/gup.c
index 4bc57420f53529a744ff077364313216151d8136..91629b5b0636707fc2eb07767da768faecdab651 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -1528,7 +1528,7 @@ static long __get_user_pages_locked(struct mm_struct *mm, unsigned long start,
 {
 	struct vm_area_struct *vma;
 	unsigned long vm_flags;
-	int i;
+	long i;
 
 	/* calculate required read or write permissions.
 	 * If FOLL_FORCE is set, we only require the "MAY" flags.