Merge branch 'linux-next' of git://git.infradead.org/ubi-2.6

* 'linux-next' of git://git.infradead.org/ubi-2.6:
UBI: release locks in check_corruption

+9 -7
+9 -7
drivers/mtd/ubi/scan.c
··· 787 * erased, so it became unstable and corrupted, and should be 788 * erased. 789 */ 790 - return 0; 791 } 792 793 if (err) 794 - return err; 795 796 - if (ubi_check_pattern(ubi->peb_buf1, 0xFF, ubi->leb_size)) { 797 - mutex_unlock(&ubi->buf_mutex); 798 - return 0; 799 - } 800 801 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 " ··· 805 pnum, ubi->leb_start, ubi->leb_size); 806 ubi_dbg_print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1, 807 ubi->peb_buf1, ubi->leb_size, 1); 808 mutex_unlock(&ubi->buf_mutex); 809 - return 1; 810 } 811 812 /**
··· 787 * erased, so it became unstable and corrupted, and should be 788 * erased. 789 */ 790 + err = 0; 791 + goto out_unlock; 792 } 793 794 if (err) 795 + goto out_unlock; 796 797 + if (ubi_check_pattern(ubi->peb_buf1, 0xFF, ubi->leb_size)) 798 + goto out_unlock; 799 800 ubi_err("PEB %d contains corrupted VID header, and the data does not " 801 "contain all 0xFF, this may be a non-UBI PEB or a severe VID " ··· 806 pnum, ubi->leb_start, ubi->leb_size); 807 ubi_dbg_print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1, 808 ubi->peb_buf1, ubi->leb_size, 1); 809 + err = 1; 810 + 811 + out_unlock: 812 mutex_unlock(&ubi->buf_mutex); 813 + return err; 814 } 815 816 /**