aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-05-31 08:40:40 +0300
committerGreg Kroah-Hartman <gregkh@suse.de>2011-06-23 15:28:39 -0700
commita52a4d7a57a4e83ed6cdc1b11bd5c8f1b5c8c86b (patch)
tree38d431d3dc19ad0f8f33ae3373302a711874eb53 /fs
parent382dfc31decd37188883fd659cad25e6a8dc0895 (diff)
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 <Artem.Bityutskiy@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs')
-rw-r--r--fs/ubifs/journal.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c
index d321baeca68..841f77cc93c 100644
--- a/fs/ubifs/journal.c
+++ b/fs/ubifs/journal.c
@@ -665,6 +665,7 @@ out_free:
out_release:
release_head(c, BASEHD);
+ kfree(dent);
out_ro:
ubifs_ro_mode(c, err);
if (last_reference)