[PATCH] Staging: Gasket: uninitialized return in gasket_mmap()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>

diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c
index 6511a33eb658..1f43c739a9ed 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;
 	}
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux