]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Manage.c
sysfs: Make sysfs_init() return an error code
[thirdparty/mdadm.git] / Manage.c
index 0ffb6c68dec2334047dc34a1040a88b90b269f96..618c98b4dd216c281266784c4114d06ffbb07c7f 100644 (file)
--- a/Manage.c
+++ b/Manage.c
@@ -1382,12 +1382,15 @@ int Manage_subdevs(char *devname, int fd,
        int busy = 0;
        int raid_slot = -1;
 
+       if (sysfs_init(&info, fd, NULL)) {
+               pr_err("sysfs not availabile for %s\n", devname);
+               goto abort;
+       }
+
        if (md_get_array_info(fd, &array)) {
                pr_err("Cannot get array info for %s\n", devname);
                goto abort;
        }
-       sysfs_init(&info, fd, NULL);
-
        /* array.size is only 32 bits and may be truncated.
         * So read from sysfs if possible, and record number of sectors
         */