From: Jes Sorensen Date: Fri, 4 May 2012 11:41:21 +0000 (+0200) Subject: super-intel.c: Don't try to close negative fd X-Git-Tag: mdadm-3.2.4~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=36614e95466720619f458195f1a0486d7ff32c44;p=thirdparty%2Fmdadm.git 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 --- 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))