aboutsummaryrefslogtreecommitdiff
path: root/common/cmd_ubi.c
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2008-12-10 10:32:59 +0100
committerStefan Roese <sr@denx.de>2008-12-10 12:55:29 +0100
commit3b089e4f889a2902449d55e081c886ae607cae89 (patch)
tree25f58ae327d4bdec3ffa37e6202b6a608207c6cd /common/cmd_ubi.c
parent817329351639a8895cd9b87b33aeff043f3d5a44 (diff)
UBI: Set ubi_dev.type back to DEV_TYPE_NONE upon failing initialization
With this patch we set the type back to NONE upon failing UBI partition initialization. Otherwise further calls to the UBI subsystem would try to really access the non-existing UBI partition. Thanks to Michael Lawnick for pointing this out. Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'common/cmd_ubi.c')
-rw-r--r--common/cmd_ubi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/common/cmd_ubi.c b/common/cmd_ubi.c
index fd33a6710..4c358924e 100644
--- a/common/cmd_ubi.c
+++ b/common/cmd_ubi.c
@@ -508,6 +508,7 @@ static int do_ubi(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
err = ubi_dev_scan(ubi_dev.mtd_info, ubi_dev.part_name);
if (err) {
printf("UBI init error %d\n", err);
+ ubi_dev.type = DEV_TYPE_NONE;
return err;
}