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