]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - restripe.c
(no commit message)
[thirdparty/mdadm.git] / restripe.c
index f673206102f0aea0c2b449d6ceb067a4230f1e5d..0f226e37b92850419e264e7c267b612fc6a9536f 100644 (file)
@@ -565,7 +565,8 @@ int restore_stripes(int *dest, unsigned long long *offsets,
 
        int data_disks = raid_disks - (level == 0 ? 0 : level <= 5 ? 1 : 2);
 
-       posix_memalign((void**)&stripe_buf, 4096, raid_disks * chunk_size);
+       if (posix_memalign((void**)&stripe_buf, 4096, raid_disks * chunk_size))
+               stripe_buf = NULL;
        if (zero == NULL) {
                zero = malloc(chunk_size);
                if (zero)