summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorMatthieu CASTET <matthieu.castet@parrot.com>2012-08-22 16:03:46 +0200
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-10-05 14:22:05 +0300
commitc40f51d8921867fefad4967e8376ea5f1e624030 (patch)
tree9d4d63e1d7b606ee8226a85d62e3b4a7513d7f67 /drivers/mtd
parent0aebf9c036c61c2f9b30a6a89ae6d8485b59124b (diff)
UBI: erase free PEB with bitflip in EC header
Without this patch, these PEB are not scrubbed until we put data in them. Bitflip can accumulate latter and we can loose the EC header (but VID header should be intact and allow to recover data). Signed-off-by: Matthieu Castet <matthieu.castet@parrot.com> Cc: stable@vger.kernel.org Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/ubi/attach.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
index efdbd98b64f2..f5941c48f6b7 100644
--- a/drivers/mtd/ubi/attach.c
+++ b/drivers/mtd/ubi/attach.c
@@ -975,7 +975,7 @@ static int scan_peb(struct ubi_device *ubi, struct ubi_attach_info *ai,
return err;
goto adjust_mean_ec;
case UBI_IO_FF:
- if (ec_err)
+ if (ec_err || bitflips)
err = add_to_list(ai, pnum, UBI_UNKNOWN,
UBI_UNKNOWN, ec, 1, &ai->erase);
else