mtd/fs/jffs2 readinode.c,1.146,1.147
David Woodhouse
dwmw2 at infradead.org
Sun Apr 9 18:01:39 EDT 2006
Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv14952
Modified Files:
readinode.c
Log Message:
Clean up error handling and don't return positive errno in
jffs2_do_read_inode_internal()
Index: readinode.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/readinode.c,v
retrieving revision 1.146
retrieving revision 1.147
diff -u -r1.146 -r1.147
--- readinode.c 6 Jan 2006 13:51:22 -0000 1.146
+++ readinode.c 9 Apr 2006 22:01:36 -0000 1.147
@@ -783,14 +783,14 @@
ret = jffs2_flash_read(c, ref_offset(fn->raw) + sizeof(*latest_node),
je32_to_cpu(latest_node->csize), &retlen, (char *)f->target);
- if (ret || retlen != je32_to_cpu(latest_node->csize)) {
- if (retlen != je32_to_cpu(latest_node->csize))
- ret = -EIO;
+ if (!ret && retlen != je32_to_cpu(latest_node->csize))
+ ret = -EIO;
+ if (ret) {
kfree(f->target);
f->target = NULL;
up(&f->sem);
jffs2_do_clear_inode(c, f);
- return -ret;
+ return ret;
}
f->target[je32_to_cpu(latest_node->csize)] = '\0';
More information about the linux-mtd-cvs
mailing list