]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - mm/gup.c
scsi: lpfc: Fix 16gb hbas failing cq create.
[mirror_ubuntu-bionic-kernel.git] / mm / gup.c
index e0d82b6706d72d82637bca5eaef1e35e15a1abdf..8fc23a60487d6ca8c10be6acd5a33bca6ad5b7cc 100644 (file)
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -1816,9 +1816,12 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
        len = (unsigned long) nr_pages << PAGE_SHIFT;
        end = start + len;
 
+       if (nr_pages <= 0)
+               return 0;
+
        if (unlikely(!access_ok(write ? VERIFY_WRITE : VERIFY_READ,
                                        (void __user *)start, len)))
-               return 0;
+               return -EFAULT;
 
        if (gup_fast_permitted(start, nr_pages, write)) {
                local_irq_disable();