Commit 56b04e3e authored by Sidney Amani's avatar Sidney Amani Committed by Artem Bityutskiy

UBIFS: fix memory leak on error path

UBIFS leaks memory on error path in 'mount_ubifs()'. In case of failure in
'ubifs_fixup_free_space()', it does not call 'ubifs_lpt_free()' whereas LPT
data structures can potentially be allocated. The amount of memory leaked can
be quite high -- see 'ubifs_lpt_init()'.

The bug was introduced when moving the LPT initialisation earlier in the
mount process (commit '781c5717').
Signed-off-by: default avatarSidney Amani <seed95@gmail.com>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
parent 49942976
...@@ -1301,7 +1301,7 @@ static int mount_ubifs(struct ubifs_info *c) ...@@ -1301,7 +1301,7 @@ static int mount_ubifs(struct ubifs_info *c)
if (!c->ro_mount && c->space_fixup) { if (!c->ro_mount && c->space_fixup) {
err = ubifs_fixup_free_space(c); err = ubifs_fixup_free_space(c);
if (err) if (err)
goto out_master; goto out_lpt;
} }
if (!c->ro_mount) { if (!c->ro_mount) {
......
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