]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super-gpt.c
imsm: FIX: Do not allow spare activation during rebuild
[thirdparty/mdadm.git] / super-gpt.c
index e70a6fac3be9e5f2e467f292375d45aa8386726b..b8c9aae9baeb7e1e0abaa2136bc0a0a5747a2daa 100644 (file)
@@ -179,8 +179,10 @@ static struct supertype *match_metadata_desc(char *arg)
 
        if (!st)
                return st;
-       if (strcmp(arg, "gpt") != 0)
+       if (strcmp(arg, "gpt") != 0) {
+               free(st);
                return NULL;
+       }
 
        st->ss = &gpt;
        st->info = NULL;
@@ -193,7 +195,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)
 {
@@ -205,8 +207,8 @@ static int validate_geometry(struct supertype *st, int level,
 struct superswitch gpt = {
 #ifndef MDASSEMBLE
        .examine_super = examine_gpt,
-#endif
        .validate_geometry = validate_geometry,
+#endif
        .match_metadata_desc = match_metadata_desc,
        .load_super = load_gpt,
        .store_super = store_gpt,