]> err.no Git - linux-2.6/blobdiff - drivers/mtd/rfd_ftl.c
Merge branch 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6
[linux-2.6] / drivers / mtd / rfd_ftl.c
index d60cc6696cbd6cac2778148f7d47c8abce839630..823fba4e6d2fa99c5c5ea2049edd820c9fda1c5c 100644 (file)
@@ -768,7 +768,7 @@ static void rfd_ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
        if (mtd->type != MTD_NORFLASH)
                return;
 
-       part = kcalloc(1, sizeof(struct partition), GFP_KERNEL);
+       part = kzalloc(sizeof(struct partition), GFP_KERNEL);
        if (!part)
                return;
 
@@ -779,9 +779,8 @@ static void rfd_ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
        else {
                if (!mtd->erasesize) {
                        printk(KERN_WARNING PREFIX "please provide block_size");
-                       return;
-               }
-               else
+                       goto out;
+               } else
                        part->block_size = mtd->erasesize;
        }
 
@@ -803,7 +802,7 @@ static void rfd_ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
                if (!add_mtd_blktrans_dev((void*)part))
                        return;
        }
-
+out:
        kfree(part);
 }