Commit 8d9ba4b8 authored by Artem Bityutskiy's avatar Artem Bityutskiy Committed by Greg Kroah-Hartman

UBIFS: fix memory leak on error path

commit 812eb258 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: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 439aa7df
......@@ -665,6 +665,7 @@ int ubifs_jnl_update(struct ubifs_info *c, const struct inode *dir,
out_release:
release_head(c, BASEHD);
kfree(dent);
out_ro:
ubifs_ro_mode(c, err);
if (last_reference)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment