lkml.org 
[lkml]   [2021]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.12 556/700] backlight: lm3630a_bl: Put fwnode in error case during ->probe()
    Date
    From: Andy Shevchenko <andy.shevchenko@gmail.com>

    [ Upstream commit 6d1c32dbedd7d7e7372aa38033ec8782c39f6379 ]

    device_for_each_child_node() bumps a reference counting of a returned variable.
    We have to balance it whenever we return to the caller.

    Cc: Brian Masney <masneyb@onstation.org>
    Cc: Dan Murphy <dmurphy@ti.com>
    Fixes: 8fbce8efe15cd ("backlight: lm3630a: Add firmware node support")
    Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
    Reviewed-by: Brian Masney <masneyb@onstation.org>
    Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
    Signed-off-by: Lee Jones <lee.jones@linaro.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/video/backlight/lm3630a_bl.c | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c
    index e88a2b0e5904..662029d6a3dc 100644
    --- a/drivers/video/backlight/lm3630a_bl.c
    +++ b/drivers/video/backlight/lm3630a_bl.c
    @@ -482,8 +482,10 @@ static int lm3630a_parse_node(struct lm3630a_chip *pchip,

    device_for_each_child_node(pchip->dev, node) {
    ret = lm3630a_parse_bank(pdata, node, &seen_led_sources);
    - if (ret)
    + if (ret) {
    + fwnode_handle_put(node);
    return ret;
    + }
    }

    return ret;
    --
    2.30.2


    \
     
     \ /
      Last update: 2021-07-12 10:10    [W:4.447 / U:1.268 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site