aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-07-06 11:37:56 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-06 17:35:42 +0200
commit97b23455ccd53a632585d0fd06ff9d30877c810a (patch)
tree7b87799224ee71185f6ae709c0d1f201144b01bc
parent9f2378d94d0f026389fff351848f2adc484650fe (diff)
downloadstaging-97b23455ccd53a632585d0fd06ff9d30877c810a.tar.gz
Staging: Gasket: uninitialized return in gasket_mmap()
We forgot to set the error code on this error path so ret can be uninitialized. Fixes: 9a69f5087ccc ("drivers/staging: Gasket driver framework + Apex driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/gasket/gasket_core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c
index 82b3eca7774e8..ad9442a5bb9d2 100644
--- a/drivers/staging/gasket/gasket_core.c
+++ b/drivers/staging/gasket/gasket_core.c
@@ -1719,8 +1719,10 @@ static int gasket_mmap(struct file *filp, struct vm_area_struct *vma)
/* Try the next region if this one was not mappable. */
if (map_status == DO_MAP_REGION_INVALID)
continue;
- if (map_status == DO_MAP_REGION_FAILURE)
+ if (map_status == DO_MAP_REGION_FAILURE) {
+ ret = -ENOMEM;
goto fail;
+ }
has_mapped_anything = 1;
}