]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mtd/cmdlinepart.c
Merge branch 'omap-fixes'
[linux-2.6-omap-h63xx.git] / drivers / mtd / cmdlinepart.c
index 50a340388e742024945b6011490c760d0de4dcad..6b172a4f88627607912887178e9b176161e9dc2a 100644 (file)
@@ -335,7 +335,11 @@ static int parse_cmdline_partitions(struct mtd_info *master,
                                }
                                offset += part->parts[i].size;
                        }
-                       *pparts = part->parts;
+                       *pparts = kmemdup(part->parts,
+                                       sizeof(*part->parts) * part->num_parts,
+                                       GFP_KERNEL);
+                       if (!*pparts)
+                               return -ENOMEM;
                        return part->num_parts;
                }
        }
@@ -350,7 +354,7 @@ static int parse_cmdline_partitions(struct mtd_info *master,
  *
  * This function needs to be visible for bootloaders.
  */
-static int mtdpart_setup(char *s)
+int mtdpart_setup(char *s)
 {
        cmdline = s;
        return 1;