diff options
Diffstat (limited to 'drivers/mtd/ubi/scan.c')
| -rw-r--r-- | drivers/mtd/ubi/scan.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c index c57e8eff9866..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); |
| 391 | out_free_vidh: | 396 | out_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 | ||
| @@ -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 */ |
