diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2016-06-14 09:13:42 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-06-14 09:13:42 +0200 |
commit | 6ac698af96a59b08e3ede5fea4fa8bf23e847a33 (patch) | |
tree | edbb5f0b693e193083a5d86a084c974850251a25 | |
parent | d059216c48d378c0e05bf987ef832522ec4c9e63 (diff) | |
parent | 3dca2b0bf7936eedce9c551253c70921f0485991 (diff) | |
download | barebox-6ac698af96a59b08e3ede5fea4fa8bf23e847a33.tar.gz barebox-6ac698af96a59b08e3ede5fea4fa8bf23e847a33.tar.xz |
Merge branch 'for-next/ubiformat'
-rw-r--r-- | lib/libscan.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/libscan.c b/lib/libscan.c index bf298a70bb..74a24b5011 100644 --- a/lib/libscan.c +++ b/lib/libscan.c @@ -82,8 +82,13 @@ int libscan_ubi_scan(struct mtd_info *mtd, struct ubi_scan_info **info, } ret = mtd_peb_read(mtd, &ech, eb, 0, sizeof(struct ubi_ec_hdr)); - if (ret < 0) - goto out_ec; + if (ret < 0 && !mtd_is_bitflip(ret)) { + si->corrupted_cnt += 1; + si->ec[eb] = EB_CORRUPTED; + if (v) + printf(": not readable\n"); + continue; + } if (be32_to_cpu(ech.magic) != UBI_EC_HDR_MAGIC) { if (mtd_buf_all_ff(&ech, sizeof(struct ubi_ec_hdr))) { |