jffs2: clean the cache in case of malloc fails in build_lists
authorIlya Yanok <yanok@emcraft.com>
Wed, 12 Aug 2009 12:42:48 +0000 (16:42 +0400)
committerWolfgang Denk <wd@denx.de>
Tue, 18 Aug 2009 19:30:58 +0000 (21:30 +0200)
commitb644006e1a7baa227aedc606ecdf0bb5eeb24cab
tree05c8d9f1d0a2c1bbe5135d841be32e87a7e8989a
parent7ff66bb0be80cadd681be22a72e5eb02ee14c878
jffs2: clean the cache in case of malloc fails in build_lists

We should call jffs2_clean_cache() if we return from jffs2_build_lists()
with an error to prevent usage of incomplete lists. Also we should
free() a local buffer to prevent memory leaks.

Signed-off-by: Ilya Yanok <yanok@emcraft.com>
fs/jffs2/jffs2_1pass.c