Browse Source

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>
Stefan Roese 16 năm trước cách đây
mục cha
commit
3b089e4f88
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      common/cmd_ubi.c

+ 1 - 0
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);
 		err = ubi_dev_scan(ubi_dev.mtd_info, ubi_dev.part_name);
 		if (err) {
 		if (err) {
 			printf("UBI init error %d\n", err);
 			printf("UBI init error %d\n", err);
+			ubi_dev.type = DEV_TYPE_NONE;
 			return err;
 			return err;
 		}
 		}