summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2014-10-25 13:26:49 +0200
committerStefan Agner <stefan@agner.ch>2015-09-01 15:02:28 -0700
commitee03b31306473588187a156b8c34f1dfe894cf35 (patch)
treefc2fd5e6ef5107a66bb054412139ccdd19fe4c2f
parente9c92de9aa17f1e97fc60a2428dee54057bad87a (diff)
UBI: Fastmap: Set used_ebs only for static volumes
If we set it for dynamic ones we might confuse various self checks. Signed-off-by: Richard Weinberger <richard@nod.at>
-rw-r--r--drivers/mtd/ubi/fastmap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
index 4c75f247c3..ba08bae12e 100644
--- a/drivers/mtd/ubi/fastmap.c
+++ b/drivers/mtd/ubi/fastmap.c
@@ -138,14 +138,15 @@ static struct ubi_ainf_volume *add_vol(struct ubi_attach_info *ai, int vol_id,
if (!av)
goto out;
- av->highest_lnum = av->leb_count = 0;
+ av->highest_lnum = av->leb_count = av->used_ebs = 0;
av->vol_id = vol_id;
- av->used_ebs = used_ebs;
av->data_pad = data_pad;
av->last_data_size = last_eb_bytes;
av->compat = 0;
av->vol_type = vol_type;
av->root = RB_ROOT;
+ if (av->vol_type == UBI_STATIC_VOLUME)
+ av->used_ebs = used_ebs;
dbg_bld("found volume (ID %i)", vol_id);