aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSidney Amani <seed95@gmail.com>2012-05-18 07:32:37 -0400
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-05-20 13:19:08 -0400
commit56b04e3e8b5cbf71c23a739f34f9a9437afa41fb (patch)
tree5eb86fdde125a73583f0063718978c6f40406c14 /fs
parent499429760650018216eb8d0b35067cf2c5c4520b (diff)
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 '781c5717a95a74b294beb38b8276943b0f8b5bb4'). Signed-off-by: Sidney Amani <seed95@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/ubifs/super.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 5b30c4db0d42..675b781b4699 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -1301,7 +1301,7 @@ static int mount_ubifs(struct ubifs_info *c)
1301 if (!c->ro_mount && c->space_fixup) { 1301 if (!c->ro_mount && c->space_fixup) {
1302 err = ubifs_fixup_free_space(c); 1302 err = ubifs_fixup_free_space(c);
1303 if (err) 1303 if (err)
1304 goto out_master; 1304 goto out_lpt;
1305 } 1305 }
1306 1306
1307 if (!c->ro_mount) { 1307 if (!c->ro_mount) {