From: Artem Bityutskiy Date: Tue, 31 May 2011 05:40:40 +0000 (+0300) Subject: UBIFS: fix memory leak on error path X-Git-Tag: v2.6.39.2~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=344bfe4456acedc5087677dd84b5a1aaa3137f8b;p=thirdparty%2Fkernel%2Fstable.git UBIFS: fix memory leak on error path commit 812eb258311f89bcd664a34a620f249d54a2cd83 upstream. UBIFS leaks memory on error path in 'ubifs_jnl_update()' in case of write failure because it forgets to free the 'struct ubifs_dent_node *dent' object. Although the object is small, the alignment can make it large - e.g., 2KiB if the min. I/O unit is 2KiB. Signed-off-by: Artem Bityutskiy Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c index aed25e864227d..e5cb2ce7bf089 100644 --- a/fs/ubifs/journal.c +++ b/fs/ubifs/journal.c @@ -666,6 +666,7 @@ out_free: out_release: release_head(c, BASEHD); + kfree(dent); out_ro: ubifs_ro_mode(c, err); if (last_reference)