]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
super-intel.c: Don't try to close negative fd
authorJes Sorensen <Jes.Sorensen@redhat.com>
Fri, 4 May 2012 11:41:21 +0000 (13:41 +0200)
committerNeilBrown <neilb@suse.de>
Sun, 6 May 2012 23:08:36 +0000 (09:08 +1000)
This should be harmless, but lets be consistent and not try to close a
negative file descripter.

Acked-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
super-intel.c

index 2e85b6b1848dc1bfb26e465c29bc83235184fba1..ca15703eb2c0b4aab7fb6d87b51759fcc51cb851 100644 (file)
@@ -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))