]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Create.c
Remove scattered checks for malloc success.
[thirdparty/mdadm.git] / Create.c
index f150954b7157b0202e7e540c8d79da397b506f08..af094952e834f568224cd5c84bef55bb5879a326 100644 (file)
--- a/Create.c
+++ b/Create.c
@@ -803,11 +803,7 @@ int Create(struct supertype *st, char *mddev,
                }
        }
 
-       infos = malloc(sizeof(*infos) * total_slots);
-       if (!infos) {
-               pr_err("Unable to allocate memory\n");
-               goto abort;
-       }
+       infos = xmalloc(sizeof(*infos) * total_slots);
 
        for (pass=1; pass <=2 ; pass++) {
                struct mddev_dev *moved_disk = NULL; /* the disk that was moved out of the insert point */
@@ -931,7 +927,7 @@ int Create(struct supertype *st, char *mddev,
 
                        /* update parent container uuid */
                        if (me) {
-                               char *path = strdup(me->path);
+                               char *path = xstrdup(me->path);
 
                                st->ss->getinfo_super(st, &info_new, NULL);
                                map_update(&map, st->container_dev,