aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2014-07-08 10:04:44 -0400
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2014-07-19 02:53:52 -0400
commite8c235b065ec07cd1c63c0e0bfbfc718d438baba (patch)
tree30ca6ba1e34721502e3838cd47337bea2303dbee
parentd4eb08ff0a8e1de010252e6646e2fc907a7e9b4e (diff)
UBI: init_volumes: Ignore volumes with no LEBs
UBI assumes that ubi_attach_info will only contain ubi_ainf_volume structures for volumes with at least one LEB. In scanning mode this is true because UBI can nicely create a ubi_ainf_volume on demand while creating the EBA table. For fastmap this is not true, the fastmap on-flash structure has a list of all volumes, the ubi_ainf_volume structures are created from this list. So it can happen that an empty volume ends up in init_volumes(). We can easely deal with that by looking into ->leb_count too. Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
-rw-r--r--drivers/mtd/ubi/vtbl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c
index d77b1c1d7c72..07cac5f9ffb8 100644
--- a/drivers/mtd/ubi/vtbl.c
+++ b/drivers/mtd/ubi/vtbl.c
@@ -591,7 +591,7 @@ static int init_volumes(struct ubi_device *ubi,
591 591
592 /* Static volumes only */ 592 /* Static volumes only */
593 av = ubi_find_av(ai, i); 593 av = ubi_find_av(ai, i);
594 if (!av) { 594 if (!av || !av->leb_count) {
595 /* 595 /*
596 * No eraseblocks belonging to this volume found. We 596 * No eraseblocks belonging to this volume found. We
597 * don't actually know whether this static volume is 597 * don't actually know whether this static volume is