diff options
| -rw-r--r-- | drivers/mtd/ubi/scan.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c index 3c631863bf4..204345be8e6 100644 --- a/drivers/mtd/ubi/scan.c +++ b/drivers/mtd/ubi/scan.c | |||
| @@ -787,16 +787,15 @@ static int check_corruption(struct ubi_device *ubi, struct ubi_vid_hdr *vid_hdr, | |||
| 787 | * erased, so it became unstable and corrupted, and should be | 787 | * erased, so it became unstable and corrupted, and should be |
| 788 | * erased. | 788 | * erased. |
| 789 | */ | 789 | */ |
| 790 | return 0; | 790 | err = 0; |
| 791 | goto out_unlock; | ||
| 791 | } | 792 | } |
| 792 | 793 | ||
| 793 | if (err) | 794 | if (err) |
| 794 | return err; | 795 | goto out_unlock; |
| 795 | 796 | ||
| 796 | if (ubi_check_pattern(ubi->peb_buf1, 0xFF, ubi->leb_size)) { | 797 | if (ubi_check_pattern(ubi->peb_buf1, 0xFF, ubi->leb_size)) |
| 797 | mutex_unlock(&ubi->buf_mutex); | 798 | goto out_unlock; |
| 798 | return 0; | ||
| 799 | } | ||
| 800 | 799 | ||
| 801 | ubi_err("PEB %d contains corrupted VID header, and the data does not " | 800 | ubi_err("PEB %d contains corrupted VID header, and the data does not " |
| 802 | "contain all 0xFF, this may be a non-UBI PEB or a severe VID " | 801 | "contain all 0xFF, this may be a non-UBI PEB or a severe VID " |
| @@ -806,8 +805,11 @@ static int check_corruption(struct ubi_device *ubi, struct ubi_vid_hdr *vid_hdr, | |||
| 806 | pnum, ubi->leb_start, ubi->leb_size); | 805 | pnum, ubi->leb_start, ubi->leb_size); |
| 807 | ubi_dbg_print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1, | 806 | ubi_dbg_print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1, |
| 808 | ubi->peb_buf1, ubi->leb_size, 1); | 807 | ubi->peb_buf1, ubi->leb_size, 1); |
| 808 | err = 1; | ||
| 809 | |||
| 810 | out_unlock: | ||
| 809 | mutex_unlock(&ubi->buf_mutex); | 811 | mutex_unlock(&ubi->buf_mutex); |
| 810 | return 1; | 812 | return err; |
| 811 | } | 813 | } |
| 812 | 814 | ||
| 813 | /** | 815 | /** |
