[PATCH 02/21] imsm: FIX: Opened handle is not closed

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

 



Opened file handle should be closed before function exit.

Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx>
---

 super-intel.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index 471dbd2..01ffcc8 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -8550,8 +8550,10 @@ int wait_for_reshape_imsm(struct mdinfo *sra, unsigned long long to_complete,
 		sysfs_set_str(sra, NULL, "sync_max", "max");
 		to_complete = MaxSector;
 	} else {
-		if (completed > to_complete)
+		if (completed > to_complete) {
+			close(fd);
 			return -1;
+		}
 		if (sysfs_set_num(sra, NULL, "sync_max",
 				  to_complete / ndata) != 0) {
 			close(fd);

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