]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
ahci_enumerate_ports(): Don't close fd that failed to open
authorJes Sorensen <Jes.Sorensen@redhat.com>
Wed, 2 Nov 2011 21:08:34 +0000 (08:08 +1100)
committerNeilBrown <neilb@suse.de>
Wed, 2 Nov 2011 21:08:34 +0000 (08:08 +1100)
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
super-intel.c

index 0193fe7fcee9fc7e793b674fa8982cb7c3b340fd..b583b35c8f05ee612c3d2a1fc92461b2cb91aee8 100644 (file)
@@ -1572,8 +1572,8 @@ static int ahci_enumerate_ports(const char *hba_path, int port_count, int host_b
                                printf(" (%.*s)\n", MAX_RAID_SERIAL_LEN, buf);
                        else
                                printf(" ()\n");
+                       close(fd);
                }
-               close(fd);
                free(path);
                path = NULL;
        }