aboutsummaryrefslogtreecommitdiff
path: root/fs/jffs2
diff options
context:
space:
mode:
authorJan Engelmohr <jan.engelmohr@mailbox.tu-dresden.de>2016-07-26 18:10:00 +0200
committerMoyster <oysterized@gmail.com>2016-08-26 15:59:39 +0200
commitd2ee3e254ee0939806c103c145035ddac9fe5953 (patch)
tree2fc8a4984c6cec24591bb68f3e0623bd1c1d45fc /fs/jffs2
parenta2904e3eed56216fe65091d9b3638ae1f90e43fa (diff)
3.10.70 -> 3.10.71
Diffstat (limited to 'fs/jffs2')
-rw-r--r--fs/jffs2/scan.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
index 7654e87b0..9ad5ba4b2 100644
--- a/fs/jffs2/scan.c
+++ b/fs/jffs2/scan.c
@@ -510,6 +510,10 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
sumlen = c->sector_size - je32_to_cpu(sm->offset);
sumptr = buf + buf_size - sumlen;
+ /* sm->offset maybe wrong but MAGIC maybe right */
+ if (sumlen > c->sector_size)
+ goto full_scan;
+
/* Now, make sure the summary itself is available */
if (sumlen > buf_size) {
/* Need to kmalloc for this. */
@@ -544,6 +548,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
}
}
+full_scan:
buf_ofs = jeb->offset;
if (!buf_size) {