aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/ubi/io.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c
index 811775aa8ee8..668d24005106 100644
--- a/drivers/mtd/ubi/io.c
+++ b/drivers/mtd/ubi/io.c
@@ -507,11 +507,13 @@ static int nor_erase_prepare(struct ubi_device *ubi, int pnum)
507 * PEB. 507 * PEB.
508 */ 508 */
509 err1 = ubi_io_read_vid_hdr(ubi, pnum, &vid_hdr, 0); 509 err1 = ubi_io_read_vid_hdr(ubi, pnum, &vid_hdr, 0);
510 if (err1 == UBI_IO_BAD_HDR_EBADMSG || err1 == UBI_IO_BAD_HDR) { 510 if (err1 == UBI_IO_BAD_HDR_EBADMSG || err1 == UBI_IO_BAD_HDR ||
511 err1 == UBI_IO_FF) {
511 struct ubi_ec_hdr ec_hdr; 512 struct ubi_ec_hdr ec_hdr;
512 513
513 err1 = ubi_io_read_ec_hdr(ubi, pnum, &ec_hdr, 0); 514 err1 = ubi_io_read_ec_hdr(ubi, pnum, &ec_hdr, 0);
514 if (err1 == UBI_IO_BAD_HDR_EBADMSG || err1 == UBI_IO_BAD_HDR) 515 if (err1 == UBI_IO_BAD_HDR_EBADMSG || err1 == UBI_IO_BAD_HDR ||
516 err1 == UBI_IO_FF)
515 /* 517 /*
516 * Both VID and EC headers are corrupted, so we can 518 * Both VID and EC headers are corrupted, so we can
517 * safely erase this PEB and not afraid that it will be 519 * safely erase this PEB and not afraid that it will be