summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mm/nommu.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mm/nommu.c b/mm/nommu.c
index ed3934bc2de4..11fd558be5ed 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -1035,6 +1035,9 @@ unsigned long do_mmap(struct file *file,
if (ret < 0)
return ret;
+ if (current->mm->map_count >= get_sysctl_max_map_count())
+ return -ENOMEM;
+
/* we ignore the address hint */
addr = 0;
len = PAGE_ALIGN(len);