aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mm/hugetlb.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2018-03-24 09:25:26 +0100
committerIngo Molnar <mingo@kernel.org>2018-03-24 09:25:26 +0100
commitea2301b6220117398a1de4f4bc853fbe886d5e08 (patch)
tree8823c3becd0b4fd3db9706892845cd02f760627a /mm/hugetlb.c
parentswiotlb: Make swiotlb_{alloc,free}_buffer depend on CONFIG_DMA_DIRECT_OPS (diff)
parentMerge tag 'trace-v4.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace (diff)
downloadwireguard-linux-ea2301b6220117398a1de4f4bc853fbe886d5e08.tar.xz
wireguard-linux-ea2301b6220117398a1de4f4bc853fbe886d5e08.zip
Merge branch 'linus' into x86/dma, to resolve a conflict with upstream
Conflicts: arch/x86/mm/init_64.c Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r--mm/hugetlb.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index a963f2034dfc..976bbc5646fe 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -18,6 +18,7 @@
#include <linux/bootmem.h>
#include <linux/sysfs.h>
#include <linux/slab.h>
+#include <linux/mmdebug.h>
#include <linux/sched/signal.h>
#include <linux/rmap.h>
#include <linux/string_helpers.h>
@@ -4374,6 +4375,12 @@ int hugetlb_reserve_pages(struct inode *inode,
struct resv_map *resv_map;
long gbl_reserve;
+ /* This should never happen */
+ if (from > to) {
+ VM_WARN(1, "%s called with a negative range\n", __func__);
+ return -EINVAL;
+ }
+
/*
* Only apply hugepage reservation if asked. At fault time, an
* attempt will be made for VM_NORESERVE to allocate a page