lkml.org 
[lkml]   [2019]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.4 76/88] dlm: fixed memory leaks after failed ls_remove_names allocation
    Date
    4.4-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Vasily Averin <vvs@virtuozzo.com>

    commit b982896cdb6e6a6b89d86dfb39df489d9df51e14 upstream.

    If allocation fails on last elements of array need to free already
    allocated elements.

    v2: just move existing out_rsbtbl label to right place

    Fixes 789924ba635f ("dlm: fix race between remove and lookup")
    Cc: stable@kernel.org # 3.6

    Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
    Signed-off-by: David Teigland <teigland@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    fs/dlm/lockspace.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/fs/dlm/lockspace.c
    +++ b/fs/dlm/lockspace.c
    @@ -673,11 +673,11 @@ static int new_lockspace(const char *nam
    kfree(ls->ls_recover_buf);
    out_lkbidr:
    idr_destroy(&ls->ls_lkbidr);
    + out_rsbtbl:
    for (i = 0; i < DLM_REMOVE_NAMES_MAX; i++) {
    if (ls->ls_remove_names[i])
    kfree(ls->ls_remove_names[i]);
    }
    - out_rsbtbl:
    vfree(ls->ls_rsbtbl);
    out_lsfree:
    if (do_unreg)

    \
     
     \ /
      Last update: 2019-01-11 15:20    [W:4.426 / U:0.064 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site