]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Create.c
sysfs: Make sysfs_init() return an error code
[thirdparty/mdadm.git] / Create.c
index 0e0778ff5327054e7b86be98279ce3903ed871d9..32987af3e5c7921c1e72a339251f2dce69d8e940 100644 (file)
--- a/Create.c
+++ b/Create.c
@@ -737,7 +737,10 @@ int Create(struct supertype *st, char *mddev,
 
        total_slots = info.array.nr_disks;
        st->ss->getinfo_super(st, &info, NULL);
-       sysfs_init(&info, mdfd, NULL);
+       if (sysfs_init(&info, mdfd, NULL)) {
+               pr_err("unable to initialize sysfs\n");
+               goto abort_locked;
+       }
 
        if (did_default && c->verbose >= 0) {
                if (is_subarray(info.text_version)) {
@@ -794,7 +797,10 @@ int Create(struct supertype *st, char *mddev,
                s->bitmap_file = NULL;
        }
 
-       sysfs_init(&info, mdfd, NULL);
+       if (sysfs_init(&info, mdfd, NULL)) {
+               pr_err("unable to initialize sysfs\n");
+               goto abort_locked;
+       }
 
        if (st->ss->external && st->container_devnm[0]) {
                /* member */