]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super-mbr.c
__write_init_super_ddf(): Use posix_memalign() instead of static aligned buffer
[thirdparty/mdadm.git] / super-mbr.c
index 0129fd695223020ebb6f7f4d2952a7cd235f7395..64999637229452477cddfcb9340ff20c3c27e48a 100644 (file)
@@ -169,13 +169,14 @@ static void getinfo_mbr(struct supertype *st, struct mdinfo *info, char *map)
 
 static struct supertype *match_metadata_desc(char *arg)
 {
-       struct supertype *st = malloc(sizeof(*st));
+       struct supertype *st;
 
-       if (!st)
-               return st;
        if (strcmp(arg, "mbr") != 0)
                return NULL;
 
+       st = malloc(sizeof(*st));
+       if (!st)
+               return st;
        st->ss = &mbr;
        st->info = NULL;
        st->minor_version = 0;
@@ -187,7 +188,7 @@ static struct supertype *match_metadata_desc(char *arg)
 #ifndef MDASSEMBLE
 static int validate_geometry(struct supertype *st, int level,
                             int layout, int raiddisks,
-                            int chunk, unsigned long long size,
+                            int *chunk, unsigned long long size,
                             char *subdev, unsigned long long *freesize,
                             int verbose)
 {
@@ -199,8 +200,8 @@ static int validate_geometry(struct supertype *st, int level,
 struct superswitch mbr = {
 #ifndef MDASSEMBLE
        .examine_super = examine_mbr,
-#endif
        .validate_geometry = validate_geometry,
+#endif
        .match_metadata_desc = match_metadata_desc,
        .load_super = load_super_mbr,
        .store_super = store_mbr,