aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/ubi/scan.c')
-rw-r--r--drivers/mtd/ubi/scan.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c
index c7b0afc9d280..05aa3e7daba1 100644
--- a/drivers/mtd/ubi/scan.c
+++ b/drivers/mtd/ubi/scan.c
@@ -286,9 +286,14 @@ static int compare_lebs(struct ubi_device *ubi, const struct ubi_scan_leb *seb,
286 * FIXME: but this is anyway obsolete and will be removed at 286 * FIXME: but this is anyway obsolete and will be removed at
287 * some point. 287 * some point.
288 */ 288 */
289
290 dbg_bld("using old crappy leb_ver stuff"); 289 dbg_bld("using old crappy leb_ver stuff");
291 290
291 if (v1 == v2) {
292 ubi_err("PEB %d and PEB %d have the same version %lld",
293 seb->pnum, pnum, v1);
294 return -EINVAL;
295 }
296
292 abs = v1 - v2; 297 abs = v1 - v2;
293 if (abs < 0) 298 if (abs < 0)
294 abs = -abs; 299 abs = -abs;
@@ -390,7 +395,6 @@ out_free_buf:
390 vfree(buf); 395 vfree(buf);
391out_free_vidh: 396out_free_vidh:
392 ubi_free_vid_hdr(ubi, vh); 397 ubi_free_vid_hdr(ubi, vh);
393 ubi_assert(err < 0);
394 return err; 398 return err;
395} 399}
396 400
@@ -769,7 +773,7 @@ struct ubi_scan_leb *ubi_scan_get_free_peb(struct ubi_device *ubi,
769 */ 773 */
770static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si, int pnum) 774static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si, int pnum)
771{ 775{
772 long long ec; 776 long long uninitialized_var(ec);
773 int err, bitflips = 0, vol_id, ec_corr = 0; 777 int err, bitflips = 0, vol_id, ec_corr = 0;
774 778
775 dbg_bld("scan PEB %d", pnum); 779 dbg_bld("scan PEB %d", pnum);
@@ -854,7 +858,7 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si, int pnum
854 } 858 }
855 859
856 vol_id = be32_to_cpu(vidh->vol_id); 860 vol_id = be32_to_cpu(vidh->vol_id);
857 if (vol_id > UBI_MAX_VOLUMES && vol_id != UBI_LAYOUT_VOL_ID) { 861 if (vol_id > UBI_MAX_VOLUMES && vol_id != UBI_LAYOUT_VOLUME_ID) {
858 int lnum = be32_to_cpu(vidh->lnum); 862 int lnum = be32_to_cpu(vidh->lnum);
859 863
860 /* Unsupported internal volume */ 864 /* Unsupported internal volume */