summaryrefslogtreecommitdiff
path: root/fs/jffs2
diff options
context:
space:
mode:
authorwdenk <wdenk>2004-05-05 19:44:41 +0000
committerwdenk <wdenk>2004-05-05 19:44:41 +0000
commit32877d66aa5f49469ee3ade6a258290f587ea420 (patch)
tree3abac28fa7bf6100781307decec970efa0b62e3d /fs/jffs2
parent62b4ac98a46cd091042b8d2801cb989a8c7c538d (diff)
* Fix memory leak in the NAND-specific JFFS2 code
* Fix SL811 USB controller when attached to a USB hub
Diffstat (limited to 'fs/jffs2')
-rw-r--r--fs/jffs2/jffs2_1pass.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c
index 7bfcc0484df..24b446c1a5c 100644
--- a/fs/jffs2/jffs2_1pass.c
+++ b/fs/jffs2/jffs2_1pass.c
@@ -217,7 +217,8 @@ static void *get_fl_mem(u32 off, u32 size, void *ext_buf)
return NULL;
}
if (read_nand_cached(off, size, buf) < 0) {
- free(buf);
+ if (!ext_buf)
+ free(buf);
return NULL;
}
@@ -756,9 +757,11 @@ jffs2_1pass_list_inodes(struct b_lists * pL, u32 pino)
while (b2) {
jNode = (struct jffs2_raw_inode *)
get_fl_mem(b2->offset, sizeof(ojNode), &ojNode);
- if (jNode->ino == jDir->ino
- && jNode->version >= i_version)
+ if (jNode->ino == jDir->ino && jNode->version >= i_version) {
+ if (i)
+ put_fl_mem(i);
i = get_fl_mem(b2->offset, sizeof(*i), NULL);
+ }
b2 = b2->next;
}