diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> | 2021-04-23 12:18:15 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-07-20 16:05:54 +0200 |
commit | 3f526ea670d85c21bbca8033b0f91a0825a869e7 (patch) | |
tree | 3d2852c177e1529d420f128eef3bcbcb8897f6d2 | |
parent | 84fa4a10631af3672dd51a684d2f658672be735e (diff) | |
download | linux-stable-3f526ea670d85c21bbca8033b0f91a0825a869e7.tar.gz linux-stable-3f526ea670d85c21bbca8033b0f91a0825a869e7.tar.bz2 linux-stable-3f526ea670d85c21bbca8033b0f91a0825a869e7.zip |
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>
-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 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; + } } } |