lkml.org 
[lkml]   [2019]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 6/7] drm: rcar-du: fix possible object reference leak
    Date
    The call to of_get_parent returns a node pointer with refcount
    incremented thus it must be explicitly decremented after the last
    usage.

    Detected by coccinelle with the following warnings:
    drivers/gpu/drm/rcar-du/rcar_du_of.c:235:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 216, but without a corresponding object release within this function.
    drivers/gpu/drm/rcar-du/rcar_du_of.c:236:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 209, but without a corresponding object release within this function.

    Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
    Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    Cc: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
    Cc: David Airlie <airlied@linux.ie>
    Cc: Daniel Vetter <daniel@ffwll.ch>
    Cc: dri-devel@lists.freedesktop.org
    Cc: linux-renesas-soc@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org (open list)
    ---
    drivers/gpu/drm/rcar-du/rcar_du_of.c | 2 ++
    1 file changed, 2 insertions(+)

    diff --git a/drivers/gpu/drm/rcar-du/rcar_du_of.c b/drivers/gpu/drm/rcar-du/rcar_du_of.c
    index afef696..30bceca 100644
    --- a/drivers/gpu/drm/rcar-du/rcar_du_of.c
    +++ b/drivers/gpu/drm/rcar-du/rcar_du_of.c
    @@ -232,6 +232,8 @@ static void __init rcar_du_of_lvds_patch(const struct of_device_id *of_ids)
    lvds_node = of_find_compatible_node(NULL, NULL, compatible);
    if (lvds_node) {
    of_node_put(lvds_node);
    + of_node_put(soc_node);
    + of_node_put(du_node);
    return;
    }

    --
    2.9.5
    \
     
     \ /
      Last update: 2019-04-03 18:04    [W:4.315 / U:0.388 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site