浏览代码

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>
Dan Carpenter 7 年之前
父节点
当前提交
97b23455cc
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      drivers/staging/gasket/gasket_core.c

+ 3 - 1
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. */
 		/* Try the next region if this one was not mappable. */
 		if (map_status == DO_MAP_REGION_INVALID)
 		if (map_status == DO_MAP_REGION_INVALID)
 			continue;
 			continue;
-		if (map_status == DO_MAP_REGION_FAILURE)
+		if (map_status == DO_MAP_REGION_FAILURE) {
+			ret = -ENOMEM;
 			goto fail;
 			goto fail;
+		}
 
 
 		has_mapped_anything = 1;
 		has_mapped_anything = 1;
 	}
 	}