security: trim security.h
[deliverable/linux.git] / mm / mmap.c
index db05495d6d0a78661d35e0855a815a5e3496b505..694a8625ab0dec227b76a21d3b5fab2a3f1bc94e 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -935,6 +935,19 @@ void vm_stat_account(struct mm_struct *mm, unsigned long flags,
 }
 #endif /* CONFIG_PROC_FS */
 
+/*
+ * If a hint addr is less than mmap_min_addr change hint to be as
+ * low as possible but still greater than mmap_min_addr
+ */
+static inline unsigned long round_hint_to_min(unsigned long hint)
+{
+       hint &= PAGE_MASK;
+       if (((void *)hint != NULL) &&
+           (hint < mmap_min_addr))
+               return PAGE_ALIGN(mmap_min_addr);
+       return hint;
+}
+
 /*
  * The caller must hold down_write(&current->mm->mmap_sem).
  */
This page took 0.02608 seconds and 5 git commands to generate.