summaryrefslogtreecommitdiffstats
path: root/fs/jffs2/readinode.c
diff options
context:
space:
mode:
authorArtem B. Bityutskiy <dedekind@infradead.org>2005-08-04 13:40:02 +0200
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-11-06 18:35:36 +0100
commit3c09133739beff0d5ad457dfcfc85c7c350d3661 (patch)
tree171320f1919f6be98a90a08c3a88d84120456967 /fs/jffs2/readinode.c
parent[JFFS2] Debug code clean up - step 6 (diff)
downloadlinux-3c09133739beff0d5ad457dfcfc85c7c350d3661.tar.xz
linux-3c09133739beff0d5ad457dfcfc85c7c350d3661.zip
[JFFS2] Correct buggy length checks
The previous changes introduced wrong length calculations. Signed-off-by: Artem B. Bityutskiy <dedekind@infradead.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'fs/jffs2/readinode.c')
-rw-r--r--fs/jffs2/readinode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c
index e6076fa5560f..12a3aaeb2f7e 100644
--- a/fs/jffs2/readinode.c
+++ b/fs/jffs2/readinode.c
@@ -7,7 +7,7 @@
*
* For licensing information, see the file 'LICENCE' in this directory.
*
- * $Id: readinode.c,v 1.137 2005/08/03 09:26:46 dedekind Exp $
+ * $Id: readinode.c,v 1.138 2005/08/03 09:28:06 dedekind Exp $
*
*/
@@ -278,7 +278,7 @@ static inline int read_dnode(struct jffs2_sb_info *c, struct jffs2_raw_node_ref
/* If we actually calculated the whole data CRC
* and it is wrong, drop the node. */
- if (len == csize && unlikely(tn->partial_crc != je32_to_cpu(rd->data_crc))) {
+ if (len >= csize && unlikely(tn->partial_crc != je32_to_cpu(rd->data_crc))) {
JFFS2_NOTICE("wrong data CRC in data node at 0x%08x: read %#08x, calculated %#08x.\n",
ref_offset(ref), tn->partial_crc, je32_to_cpu(rd->data_crc));
goto free_out;