lkml.org 
[lkml]   [2019]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL 4.19 133/219] powerpc/pseries: Fix node leak in update_lmb_associativity_index()
    Date
    From: Michael Ellerman <mpe@ellerman.id.au>

    [ Upstream commit 47918bc68b7427e961035949cc1501a864578a69 ]

    In update_lmb_associativity_index() we lookup dr_node using
    of_find_node_by_path() which takes a reference for us. In the
    non-error case we forget to drop the reference. Note that
    find_aa_index() does modify properties of the node, but doesn't need
    an extra reference held once it's returned.

    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    arch/powerpc/platforms/pseries/hotplug-memory.c | 1 +
    1 file changed, 1 insertion(+)

    diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
    index f99cd31b6fd1a..8a1c2c8963214 100644
    --- a/arch/powerpc/platforms/pseries/hotplug-memory.c
    +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
    @@ -202,6 +202,7 @@ static u32 lookup_lmb_associativity_index(struct drmem_lmb *lmb)

    aa_index = find_aa_index(dr_node, ala_prop, lmb_assoc);

    + of_node_put(dr_node);
    dlpar_free_cc_nodes(lmb_node);
    return aa_index;
    }
    --
    2.20.1
    \
     
     \ /
      Last update: 2019-11-22 06:52    [W:4.074 / U:0.340 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site