lkml.org 
[lkml]   [2011]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] [35/99] UBIFS: fix memory leak on error path
    Date
    2.6.35-longterm review patch.  If anyone has any objections, please let me know.

    ------------------
    From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

    commit 812eb258311f89bcd664a34a620f249d54a2cd83 upstream.

    UBIFS leaks memory on error path in 'ubifs_jnl_update()' in case of write
    failure because it forgets to free the 'struct ubifs_dent_node *dent' object.
    Although the object is small, the alignment can make it large - e.g., 2KiB
    if the min. I/O unit is 2KiB.

    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Andi Kleen <ak@linux.intel.com>

    ---
    fs/ubifs/journal.c | 1 +
    1 file changed, 1 insertion(+)

    Index: linux-2.6.35.y/fs/ubifs/journal.c
    ===================================================================
    --- linux-2.6.35.y.orig/fs/ubifs/journal.c
    +++ linux-2.6.35.y/fs/ubifs/journal.c
    @@ -665,6 +665,7 @@ out_free:

    out_release:
    release_head(c, BASEHD);
    + kfree(dent);
    out_ro:
    ubifs_ro_mode(c, err);
    if (last_reference)

    \
     
     \ /
      Last update: 2011-07-28 00:09    [W:2.898 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site