Skip to content

Commit

Permalink
memory: atmel-ebi: add missing of_node_put for loop iteration
Browse files Browse the repository at this point in the history
[ Upstream commit 907c5bb ]

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: 6a4ec4c ("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>
  • Loading branch information
krzk authored and gregkh committed Jul 20, 2021
1 parent e075ad2 commit 19c0f82
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/memory/atmel-ebi.c
Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit 19c0f82

Please sign in to comment.