mtd/fs/jffs2 readinode.c,1.121,1.122

Artem Bityuckiy dedekind at infradead.org
Thu Jul 7 09:24:47 EDT 2005


Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv7373

Modified Files:
	readinode.c 
Log Message:
Free the allocated fragment if we unable to insert it.


Index: readinode.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/readinode.c,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -r1.121 -r1.122
--- readinode.c	6 Jul 2005 16:16:24 -0000	1.121
+++ readinode.c	7 Jul 2005 13:24:43 -0000	1.122
@@ -169,8 +169,10 @@
 	newfrag->node->frags = 1;
 
 	ret = jffs2_add_frag_to_fragtree(c, &f->fragtree, newfrag);
-	if (ret)
+	if (unlikely(ret)) {
+		jffs2_free_node_frag(newfrag)
 		return ret;
+	}
 
 	/* If we now share a page with other nodes, mark either previous
 	   or next node REF_NORMAL, as appropriate.  */





More information about the linux-mtd-cvs mailing list