[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Sat, 10 Oct 2015 14:30:49 +0200
From: Julia Lawall <Julia.Lawall@...6.fr>
To: linux-pm@...r.kernel.org
Cc: kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-fbdev@...r.kernel.org, linux-sh@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
Russell King - ARM Linux <linux@....linux.org.uk>,
Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>,
Andrew Lunn <andrew@...n.ch>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Jason Cooper <jason@...edaemon.net>
Subject: [PATCH 0/5] add missing of_node_put
for_each_child_of_node performs an of_node_get on each iteration, so
a break out of the loop requires an of_node_put.
The complete semantic patch that fixes this problem is
(http://coccinelle.lip6.fr):
// <smpl>
@@
expression root,e;
local idexpression child;
iterator name for_each_child_of_node;
@@
for_each_child_of_node(root, child) {
... when != of_node_put(child)
when != e = child
+ of_node_put(child);
? break;
...
}
... when != child
@@
expression root,e;
local idexpression child;
@@
for_each_child_of_node(root, child) {
... when != of_node_put(child)
when != e = child
(
return child;
|
+ of_node_put(child);
? return ...;
)
...
}
// </smpl>
---
arch/arm/kernel/devtree.c | 1 +
arch/arm/mach-shmobile/pm-rmobile.c | 4 +++-
drivers/power/charger-manager.c | 4 +++-
drivers/regulator/of_regulator.c | 1 +
drivers/video/backlight/88pm860x_bl.c | 1 +
5 files changed, 9 insertions(+), 2 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists