[PATCH] UBIFS: fix memory leak on error path

Artem Bityutskiy dedekind1 at gmail.com
Fri May 18 07:38:45 EDT 2012


On Thu, 2012-05-17 at 19:03 +1000, Sidney Amani wrote:
> UBIFS leaks memory on error path in 'mount_ubifs()'. In case of failure in
> 'ubifs_lpt_init()' or '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').
> 
> CC: Ben Gardiner <bengardiner at nanometrics.ca>
> Signed-off-by: Sidney Amani <seed95 at gmail.com>

I've replied to you with the counter-proposal patches which I think
should fix this issue in a bit better way. Please, take a look - If you
are fine with that, I can push it.

-- 
Best Regards,
Artem Bityutskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20120518/b247e00a/attachment.sig>


More information about the linux-mtd mailing list