OSDN Git Service

Merge tag 'hwmon-for-v5.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/groec...
[uclinux-h8/linux.git] / mm / gup_benchmark.c
index debf113..5b42d3d 100644 (file)
@@ -27,6 +27,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)