From 36614e95466720619f458195f1a0486d7ff32c44 Mon Sep 17 00:00:00 2001 From: Jes Sorensen Date: Fri, 4 May 2012 13:41:21 +0200 Subject: [PATCH] super-intel.c: Don't try to close negative fd This should be harmless, but lets be consistent and not try to close a negative file descripter. Acked-by: Dan Williams Signed-off-by: Jes Sorensen Signed-off-by: NeilBrown --- super-intel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/super-intel.c b/super-intel.c index 2e85b6b1..ca15703e 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)) -- 2.47.2