if (new_size >> overridesize != nsmtd->erasesize) {
NS_ERR("overridesize is too big\n");
ret = -EINVAL;
- goto err_exit;
+ goto cleanup_nand;
}
/* N.B. This relies on nand_scan not doing anything with the size before we change it */
ret = ns_setup_wear_reporting(nsmtd);
if (ret)
- goto err_exit;
+ goto cleanup_nand;
ret = ns_init(nsmtd);
if (ret)
unregister_mtd:
WARN_ON(mtd_device_unregister(nsmtd));
-err_exit:
free_ns_object:
ns_free(ns);
free_ebw:
kfree(erase_block_wear);
+cleanup_nand:
nand_cleanup(chip);
error:
kfree(ns);