aboutsummaryrefslogtreecommitdiffstats
path: root/mm/gup_benchmark.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/gup_benchmark.c')
-rw-r--r--mm/gup_benchmark.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mm/gup_benchmark.c b/mm/gup_benchmark.c
index 7405c9d89d65..7e6f2d2dafb5 100644
--- a/mm/gup_benchmark.c
+++ b/mm/gup_benchmark.c
@@ -23,6 +23,9 @@ static int __gup_benchmark_ioctl(unsigned int cmd,
int nr;
struct page **pages;
+ if (gup->size > ULONG_MAX)
+ return -EINVAL;
+
nr_pages = gup->size / PAGE_SIZE;
pages = kvcalloc(nr_pages, sizeof(void *), GFP_KERNEL);
if (!pages)