UBIFS: fix memory leak on error path
authorSidney Amani <seed95@gmail.com>
Fri, 18 May 2012 11:32:37 +0000 (14:32 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Thu, 21 Jun 2012 11:46:16 +0000 (14:46 +0300)
commitb0802120f152a738ac44edfd7b98fc01650ad4d6
tree8f8072d926254e86912bd703fc184d35f273e720
parent5d680b83a9fbb06963653591e5df4f958f51e294
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>
fs/ubifs/super.c