diff options
author | 2018-03-31 07:30:17 +0200 | |
---|---|---|
committer | 2018-03-31 07:30:17 +0200 | |
commit | 169310f71fc820fe153ec04c6a111e444a68d6d5 (patch) | |
tree | a586d0f08548159ceb8527ff59f8414579f70c1f /mm/hugetlb.c | |
parent | lockdep: Make the lock debug output more useful (diff) | |
parent | Merge tag 'for-4.16/dm-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm (diff) | |
download | wireguard-linux-169310f71fc820fe153ec04c6a111e444a68d6d5.tar.xz wireguard-linux-169310f71fc820fe153ec04c6a111e444a68d6d5.zip |
Merge branch 'linus' into locking/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r-- | mm/hugetlb.c | 7 |
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 |