[PATCH] util: fix seg-fault when trying to kill-subarray in a non-existing container

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

 



open_subarray returns valid fd to a container. In case of error shall return
negative value.

Signed-off-by: Marcin Labun <marcin.labun@xxxxxxxxx>
---
 util.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/util.c b/util.c
index ce03239..1680d6b 100644
--- a/util.c
+++ b/util.c
@@ -1370,7 +1370,7 @@ int open_subarray(char *dev, char *subarray, struct supertype *st, int quiet)
 		if (!quiet)
 			fprintf(stderr, Name ": Couldn't open %s, aborting\n",
 				dev);
-		return 2;
+		return -2;
 	}
 
 	st->devnum = fd2devnum(fd);
-- 
1.6.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux