summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2010-11-29 08:27:07 +1100
committerJames Morris <jmorris@namei.org>2010-11-29 08:27:07 +1100
commit1d6d75684d869406e5bb2ac5d3ed9454f52d0cab (patch)
treeafb229254bed6415407b7b7d4641f9f792109966 /drivers/mtd
parent074e61ec3751da9ab88ee66d3818574556c03489 (diff)
parent0f639a3c5ca63dd76ee07de9b02ebf0178ce9a17 (diff)
downloadlinux-1d6d75684d869406e5bb2ac5d3ed9454f52d0cab.tar.gz
linux-1d6d75684d869406e5bb2ac5d3ed9454f52d0cab.tar.bz2
linux-1d6d75684d869406e5bb2ac5d3ed9454f52d0cab.zip
Merge branch 'master' into next
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/ubi/scan.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c
index 3c631863bf40..204345be8e62 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,
* erased, so it became unstable and corrupted, and should be
* erased.
*/
- return 0;
+ err = 0;
+ goto out_unlock;
}
if (err)
- return err;
+ goto out_unlock;
- if (ubi_check_pattern(ubi->peb_buf1, 0xFF, ubi->leb_size)) {
- mutex_unlock(&ubi->buf_mutex);
- return 0;
- }
+ if (ubi_check_pattern(ubi->peb_buf1, 0xFF, ubi->leb_size))
+ goto out_unlock;
ubi_err("PEB %d contains corrupted VID header, and the data does not "
"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,
pnum, ubi->leb_start, ubi->leb_size);
ubi_dbg_print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1,
ubi->peb_buf1, ubi->leb_size, 1);
+ err = 1;
+
+out_unlock:
mutex_unlock(&ubi->buf_mutex);
- return 1;
+ return err;
}
/**