diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> | 2021-04-23 13:18:15 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-07-20 17:16:14 +0300 |
commit | a2d713c0f74582354f1f1768b368cebb5dca190e (patch) | |
tree | 92354c98a621537e0b8c65bb4219d50e6db6d4cd /drivers/memory | |
parent | 2408a5e8d7f1f2f0a2daddf502ef8572df784e22 (diff) | |
download | linux-a2d713c0f74582354f1f1768b368cebb5dca190e.tar.xz |
memory: atmel-ebi: add missing of_node_put for loop iteration
[ 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>
Diffstat (limited to 'drivers/memory')
-rw-r--r-- | drivers/memory/atmel-ebi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c index b907865d4664..2b9283d4fcb1 100644 --- a/drivers/memory/atmel-ebi.c +++ b/drivers/memory/atmel-ebi.c @@ -579,8 +579,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; + } } } |