diff options
author | Richard Weinberger <richard@nod.at> | 2014-07-08 16:04:44 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-09-11 15:53:28 +0200 |
commit | 315804827234d5f1b1ea3ce23bcd04b1ca36c072 (patch) | |
tree | 8b6e682217223c6423c24b7bedea75b6be6b68f6 /drivers | |
parent | 305b1bbea903d25cf80826208d56e620db6378c0 (diff) | |
download | barebox-315804827234d5f1b1ea3ce23bcd04b1ca36c072.tar.gz barebox-315804827234d5f1b1ea3ce23bcd04b1ca36c072.tar.xz |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/ubi/vtbl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c index 48b291529f..c15809a724 100644 --- a/drivers/mtd/ubi/vtbl.c +++ b/drivers/mtd/ubi/vtbl.c @@ -580,7 +580,7 @@ static int init_volumes(struct ubi_device *ubi, /* Static volumes only */ av = ubi_find_av(ai, i); - if (!av) { + if (!av || !av->leb_count) { /* * No eraseblocks belonging to this volume found. We * don't actually know whether this static volume is |