[PATCH 1/2] super-intel.c: Don't try to close negative fd

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

 



From: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx>

This should be harmless, but lets be consistent and not try to close a
negative file descripter.

Signed-off-by: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx>
---
 super-intel.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index 2e85b6b..ca15703 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -4353,7 +4353,7 @@ static int get_super_block(struct intel_super **super_list, int devnum, char *de
 	} else {
 		if (s)
 			free(s);
-		if (dfd)
+		if (dfd >= 0)
 			close(dfd);
 	}
 	if ((dfd >= 0) && (!keep_fd))
-- 
1.7.7.6

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