staging: gasket: gasket_mmap return error instead of valid BAR index
authorTodd Poynor <toddpoynor@google.com>
Fri, 20 Jul 2018 03:49:07 +0000 (20:49 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 21 Jul 2018 06:50:35 +0000 (08:50 +0200)
When offset to be mapped matches both a BAR region and a coherent mapped
region return an error as intended, not the BAR index.

Signed-off-by: Simon Que <sque@chromium.org>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gasket/gasket_core.c

index eb5ad16..3cf918f 100644 (file)
@@ -1627,7 +1627,7 @@ static int gasket_mmap(struct file *filp, struct vm_area_struct *vma)
                        "0x%lx",
                        raw_offset);
                trace_gasket_mmap_exit(bar_index);
-               return bar_index;
+               return -EINVAL;
        }
 
        vma->vm_private_data = gasket_dev;