]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
ubi: reset mtd_devs when ubi part fail
authorHeiko Schocher <hs@denx.de>
Tue, 20 Jan 2015 08:05:23 +0000 (09:05 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 1 Sep 2015 10:57:32 +0000 (12:57 +0200)
if "ubi part" fails, reset also mtd_devs to 0, as
further "ubi part" would use wrong mtd_devs.

Signed-off-by: Heiko Schocher <hs@denx.de>
drivers/mtd/ubi/build.c

index 584cf5f22b38f4830ced26e6e011df1bd3115ac5..290d524b1be2577d8a9da710a8c3518cc2d1d632 100644 (file)
@@ -1358,6 +1358,10 @@ out_version:
 out_class:
        class_destroy(ubi_class);
 out:
+#ifdef __UBOOT__
+       /* Reset any globals that the driver depends on being zeroed */
+       mtd_devs = 0;
+#endif
        ubi_err("cannot initialize UBI, error %d", err);
        return err;
 }
@@ -1384,6 +1388,10 @@ void ubi_exit(void)
        misc_deregister(&ubi_ctrl_cdev);
        class_remove_file(ubi_class, &ubi_version);
        class_destroy(ubi_class);
+#ifdef __UBOOT__
+       /* Reset any globals that the driver depends on being zeroed */
+       mtd_devs = 0;
+#endif
 }
 module_exit(ubi_exit);