From: Todd Poynor Date: Fri, 20 Jul 2018 03:49:07 +0000 (-0700) Subject: staging: gasket: gasket_mmap return error instead of valid BAR index X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=e80d8afc97fb243833d9939b5098a89379433b3c;p=openwrt%2Fstaging%2Fblogic.git 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 --- diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c index eb5ad161ccda..3cf918f9d260 100644 --- a/drivers/staging/gasket/gasket_core.c +++ b/drivers/staging/gasket/gasket_core.c @@ -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;