Fix "ubi part" cmd re-entrancy
authorKarl Beldan <karl.beldan@gmail.com>
Thu, 23 Sep 2010 08:46:31 +0000 (10:46 +0200)
committerStefan Roese <sr@denx.de>
Mon, 27 Sep 2010 13:06:00 +0000 (15:06 +0200)
Commit 2ee951ba (UBI: Enable re-initializing of the "ubi part" command)
reset mtd_devs in ubi_exit() but missed ubi_init()'s failure path.

Signed-off-by: Karl Beldan <karl.beldan@gmail.com>
Cc: Stefan Roese <sr@denx.de>
Signed-off-by: Stefan Roese <sr@denx.de>
drivers/mtd/ubi/build.c

index 354e80b528effcdae04ee73fe9fbcff3ce6e4a5a..3ea0e6c8d18397ca35133579d4e0f7954619e0c4 100644 (file)
@@ -1045,6 +1045,7 @@ out_version:
 out_class:
        class_destroy(ubi_class);
 out:
+       mtd_devs = 0;
        ubi_err("UBI error: cannot initialize UBI, error %d", err);
        return err;
 }