lkml.org 
[lkml]   [2017]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Date
    Subject[PATCH 3.16 030/204] powerpc/pseries: Fix parent_dn reference leak in add_dt_node()
    3.16.52-rc1 review patch.  If anyone has any objections, please let me know.

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

    From: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>

    commit b537ca6fede69a281dc524983e5e633d79a10a08 upstream.

    A reference to the parent device node is held by add_dt_node() for the
    node to be added. If the call to dlpar_configure_connector() fails
    add_dt_node() returns ENOENT and that reference is not freed.

    Add a call to of_node_put(parent_dn) prior to bailing out after a
    failed dlpar_configure_connector() call.

    Fixes: 8d5ff320766f ("powerpc/pseries: Make dlpar_configure_connector parent node aware")
    Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    ---
    arch/powerpc/platforms/pseries/mobility.c | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    --- a/arch/powerpc/platforms/pseries/mobility.c
    +++ b/arch/powerpc/platforms/pseries/mobility.c
    @@ -224,8 +224,10 @@ static int add_dt_node(__be32 parent_pha
    return -ENOENT;

    dn = dlpar_configure_connector(drc_index, parent_dn);
    - if (!dn)
    + if (!dn) {
    + of_node_put(parent_dn);
    return -ENOENT;
    + }

    rc = dlpar_attach_node(dn);
    if (rc)
    \
     
     \ /
      Last update: 2017-12-28 18:39    [W:4.712 / U:0.536 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site