[PATCH 06/21] UBI: Fastmap: Ensure that new_fm->e[0]->ec is always set
Richard Weinberger
richard at nod.at
Wed Jun 13 06:42:03 EDT 2012
Signed-off-by: Richard Weinberger <richard at nod.at>
---
drivers/mtd/ubi/fastmap.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
index a82a604..c2a1c18 100644
--- a/drivers/mtd/ubi/fastmap.c
+++ b/drivers/mtd/ubi/fastmap.c
@@ -1310,7 +1310,6 @@ int ubi_update_fastmap(struct ubi_device *ubi)
}
new_fm->e[0]->pnum = old_fm->e[0]->pnum;
- new_fm->e[0]->ec = old_fm->e[0]->ec;
} else {
/* we've got a new early PEB, return the old one */
ubi_wl_put_fm_peb(ubi, old_fm->e[0], 0);
@@ -1326,9 +1325,10 @@ int ubi_update_fastmap(struct ubi_device *ubi)
goto err;
}
- new_fm->e[0]->ec = get_ec(ubi, new_fm->e[0]->pnum);
}
+ new_fm->e[0]->ec = get_ec(ubi, new_fm->e[0]->pnum);
+
if (new_fm->used_blocks > UBI_FM_MAX_BLOCKS) {
ubi_err("fastmap too large");
ret = -ENOSPC;
--
1.7.6.5
More information about the linux-mtd
mailing list