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>
/* 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;
}