Skip to content
Snippets Groups Projects
Commit 3b089e4f authored by Stefan Roese's avatar Stefan Roese
Browse files

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: default avatarStefan Roese <sr@denx.de>
parent 81732935
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment