diff options
author | Julia Lawall <Julia.Lawall@inria.fr> | 2023-09-07 11:55:17 +0200 |
---|---|---|
committer | Gregory CLEMENT <gregory.clement@bootlin.com> | 2023-09-20 11:28:02 +0200 |
commit | cc3b17cabe9fd2881eace5b7b1581914569d62e9 (patch) | |
tree | 3f6c557a96657cfbee417064d732a83effd1a0e9 | |
parent | 0bb80ecc33a8fb5a682236443c1e740d5c917d1d (diff) | |
download | linux-cc3b17cabe9fd2881eace5b7b1581914569d62e9.tar.gz linux-cc3b17cabe9fd2881eace5b7b1581914569d62e9.tar.bz2 linux-cc3b17cabe9fd2881eace5b7b1581914569d62e9.zip |
soc: dove: add missing of_node_put
for_each_available_child_of_node performs an of_node_get
on each iteration, so a break out of the loop requires an
of_node_put.
This was done using the Coccinelle semantic patch
iterators/for_each_child.cocci
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
-rw-r--r-- | drivers/soc/dove/pmu.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/soc/dove/pmu.c b/drivers/soc/dove/pmu.c index ffc5311c0ed8..6202dbcd20a8 100644 --- a/drivers/soc/dove/pmu.c +++ b/drivers/soc/dove/pmu.c @@ -410,13 +410,16 @@ int __init dove_init_pmu(void) struct pmu_domain *domain; domain = kzalloc(sizeof(*domain), GFP_KERNEL); - if (!domain) + if (!domain) { + of_node_put(np); break; + } domain->pmu = pmu; domain->base.name = kasprintf(GFP_KERNEL, "%pOFn", np); if (!domain->base.name) { kfree(domain); + of_node_put(np); break; } |