From patchwork Fri Jun 1 15:16:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [15/23] UBI: Fastmap: Use reserved_pebs Date: Fri, 01 Jun 2012 05:16:36 -0000 From: Richard Weinberger X-Patchwork-Id: 162338 Message-Id: <1338563804-85990-16-git-send-email-richard@nod.at> To: linux-mtd@lists.infradead.org Cc: dedekind1@gmail.com, Richard Weinberger , adrian.hunter@intel.com, Heinz.Egger@linutronix.de, shmulik.ladkani@gmail.com, tglx@linutronix.de, tim.bird@am.sony.com The eba_tbl is reserved_pebs sized, not used_ebs. Signed-off-by: Richard Weinberger --- 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 e2600cd..dad0251 100644 --- a/drivers/mtd/ubi/fastmap.c +++ b/drivers/mtd/ubi/fastmap.c @@ -993,10 +993,10 @@ static int ubi_write_fastmap(struct ubi_device *ubi, vol->vol_type == UBI_STATIC_VOLUME); feba = (struct ubi_fm_eba *)(fm_raw + fm_pos); - fm_pos += sizeof(*feba) + (sizeof(__be32) * vol->used_ebs); + fm_pos += sizeof(*feba) + (sizeof(__be32) * vol->reserved_pebs); ubi_assert(fm_pos <= new_fm->size); - for (j = 0; j < vol->used_ebs; j++) + for (j = 0; j < vol->reserved_pebs; j++) feba->pnum[j] = cpu_to_be32(vol->eba_tbl[j]); feba->reserved_pebs = cpu_to_be32(j);