From 21ea6458c216abab02c9b30a5209c018e7c173a1 Mon Sep 17 00:00:00 2001 From: Todd Poynor Date: Thu, 19 Jul 2018 20:49:07 -0700 Subject: [PATCH] staging: gasket: gasket_mmap return error instead of valid BAR index 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 Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman --- gasket_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gasket_core.c b/gasket_core.c index 7b912f1..43c63da 100644 --- a/gasket_core.c +++ b/gasket_core.c @@ -1637,7 +1637,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;