-+ slave = add_one_partition(master, dpart, 0, split_offset);
-+ if (!slave) {
-+ kfree(dpart);
-+ return -ENOMEM;
-+ }
++ slave = allocate_partition(master, dpart, 0, split_offset);
++ if (IS_ERR(slave))
++ return PTR_ERR(slave);
++ mutex_lock(&mtd_partitions_mutex);
++ list_add(&slave->list, &mtd_partitions);
++ mutex_unlock(&mtd_partitions_mutex);
++
++ add_mtd_device(&slave->mtd);
++