Skip to content

Commit

Permalink
UBIFS: fix memory leak on error path
Browse files Browse the repository at this point in the history
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 '781c5717a95a74b294beb38b8276943b0f8b5bb4').

Signed-off-by: Sidney Amani <seed95@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
  • Loading branch information
Sidney Amani authored and Artem Bityutskiy committed May 20, 2012
1 parent 4994297 commit 56b04e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ubifs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,7 @@ static int mount_ubifs(struct ubifs_info *c)
if (!c->ro_mount && c->space_fixup) {
err = ubifs_fixup_free_space(c);
if (err)
goto out_master;
goto out_lpt;
}

if (!c->ro_mount) {
Expand Down

0 comments on commit 56b04e3

Please sign in to comment.