summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@inria.fr>2023-09-07 12:55:17 +0300
committerGregory CLEMENT <gregory.clement@bootlin.com>2023-09-20 12:28:02 +0300
commitcc3b17cabe9fd2881eace5b7b1581914569d62e9 (patch)
tree3f6c557a96657cfbee417064d732a83effd1a0e9
parent0bb80ecc33a8fb5a682236443c1e740d5c917d1d (diff)
downloadlinux-cc3b17cabe9fd2881eace5b7b1581914569d62e9.tar.xz
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.c5
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;
}