summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mm/vma.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mm/vma.c b/mm/vma.c
index 68138e8c153e..8a454a7bbc80 100644
--- a/mm/vma.c
+++ b/mm/vma.c
@@ -615,7 +615,11 @@ void validate_mm(struct mm_struct *mm)
anon_vma_unlock_read(anon_vma);
}
#endif
- i++;
+ /* Check for a infinite loop */
+ if (++i > mm->map_count + 10) {
+ i = -1;
+ break;
+ }
}
if (i != mm->map_count) {
pr_emerg("map_count %d vma iterator %d\n", mm->map_count, i);