From: Julia Lawall <hidden> Date: 2018-05-23 19:39:03
The device node iterators perform an of_node_get on each iteration, so a
jump out of the loop requires an of_node_put.
---
drivers/gpu/drm/rockchip/rockchip_lvds.c | 4 +++-
drivers/pci/hotplug/pnv_php.c | 8 ++++++--
drivers/phy/hisilicon/phy-hisi-inno-usb2.c | 9 +++++++--
drivers/pinctrl/pinctrl-at91-pio4.c | 4 +++-
drivers/soc/ti/knav_dma.c | 1 +
5 files changed, 20 insertions(+), 6 deletions(-)
From: Julia Lawall <hidden> Date: 2018-05-23 19:39:06
The device node iterators perform an of_node_get on each iteration, so a
jump out of the loop requires an of_node_put.
The semantic patch that fixes this problem is as follows
(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
// </smpl>
Signed-off-by: Julia Lawall <redacted>
---
drivers/pci/hotplug/pnv_php.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
On Wed, May 23, 2018 at 09:07:15PM +0200, Julia Lawall wrote:
The device node iterators perform an of_node_get on each iteration, so a
jump out of the loop requires an of_node_put.
The semantic patch that fixes this problem is as follows
(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
// </smpl>
Signed-off-by: Julia Lawall <redacted>