git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ipv6: update skb->csum when CE mark is propagated
[pandora-kernel.git]
/
fs
/
jffs2
/
scan.c
diff --git
a/fs/jffs2/scan.c
b/fs/jffs2/scan.c
index
8d8cd34
..
327cc17
100644
(file)
--- a/
fs/jffs2/scan.c
+++ b/
fs/jffs2/scan.c
@@
-275,9
+275,7
@@
int jffs2_scan_medium(struct jffs2_sb_info *c)
else
c->mtd->unpoint(c->mtd, 0, c->mtd->size);
#endif
else
c->mtd->unpoint(c->mtd, 0, c->mtd->size);
#endif
- if (s)
- kfree(s);
-
+ kfree(s);
return ret;
}
return ret;
}
@@
-505,6
+503,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;
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. */
/* Now, make sure the summary itself is available */
if (sumlen > buf_size) {
/* Need to kmalloc for this. */
@@
-539,6
+541,7
@@
static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
}
}
}
}
+full_scan:
buf_ofs = jeb->offset;
if (!buf_size) {
buf_ofs = jeb->offset;
if (!buf_size) {