lkml.org 
[lkml]   [2021]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.13 281/351] memory: atmel-ebi: add missing of_node_put for loop iteration
    Date
    From: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>

    [ Upstream commit 907c5bbb514a4676160e79764522fff56ce3448e ]

    Early exits from for_each_available_child_of_node() should decrement the
    node reference counter. Reported by Coccinelle:

    drivers/memory/atmel-ebi.c:593:1-33: WARNING:
    Function "for_each_available_child_of_node" should have of_node_put() before return around line 604.

    Fixes: 6a4ec4cd0888 ("memory: add Atmel EBI (External Bus Interface) driver")
    Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
    Link: https://lore.kernel.org/r/20210423101815.119341-2-krzysztof.kozlowski@canonical.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/memory/atmel-ebi.c | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c
    index 14386d0b5f57..c267283b01fd 100644
    --- a/drivers/memory/atmel-ebi.c
    +++ b/drivers/memory/atmel-ebi.c
    @@ -600,8 +600,10 @@ static int atmel_ebi_probe(struct platform_device *pdev)
    child);

    ret = atmel_ebi_dev_disable(ebi, child);
    - if (ret)
    + if (ret) {
    + of_node_put(child);
    return ret;
    + }
    }
    }

    --
    2.30.2


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