mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2025-12-10 07:44:53 +01:00
common: ubi: fix ubi_initialized flag handling
This patch clears the ubi_initialized flag after doing ubi_exit since there can be chance to ubi_int failure, but still ubi_initialized flag will be set. This will result in doing ubi_exit again and uboot crash. This patch also doing put_mtd_device after deleting mtd partition to make the ref count to zero. Signed-off-by: Vandhiadevan Karunamoorthy <vkarunam@codeaurora.org> Change-Id: I5a875ec82266db6b09045602b5d1b3fe47d4bd58
This commit is contained in:
parent
081123e558
commit
89f08320cb
1 changed files with 2 additions and 0 deletions
|
|
@ -486,6 +486,8 @@ int ubi_part(char *part_name, const char *vid_header_offset)
|
|||
if (ubi_initialized) {
|
||||
ubi_exit();
|
||||
del_mtd_partitions(ubi_dev.mtd_info);
|
||||
put_mtd_device(ubi_dev.mtd_info);
|
||||
ubi_initialized = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue