WSL2-Linux-Kernel/drivers/of
Julia Lawall 855ff2878e of/unittest: 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.

A simplified version of the semantic patch that fixes this problem is as
follows (http://coccinelle.lip6.fr):

// <smpl>
@@
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>

Combine the puts into code at the end of the function, for conciseness.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Rob Herring <robh@kernel.org>
2015-10-22 09:26:28 -05:00
..
unittest-data
Kconfig
Makefile
address.c PCI: of: Add 64-bit address recognition without LPAE support 2015-10-13 13:30:37 -05:00
base.c
device.c of: to support binding numa node to specified device in devicetree 2015-09-17 14:51:55 -05:00
dynamic.c
fdt.c of/fdt: fix aliases with baudrate in earlycon 2015-10-13 13:31:26 -05:00
fdt_address.c
irq.c of/irq: make of_irq_find_parent static 2015-10-13 13:34:32 -05:00
of_mdio.c of_mdio: fix MDIO phy device refcounting 2015-09-24 23:04:52 -07:00
of_mtd.c
of_net.c
of_pci.c PCI: of: Ignore resources with failed translation 2015-10-13 13:30:42 -05:00
of_pci_irq.c of_pci_irq: Silence bogus "of_irq_parse_pci() failed ..." messages. 2015-09-17 14:46:11 -05:00
of_private.h
of_reserved_mem.c of: Check for overlap in reserved memory regions 2015-09-17 14:52:06 -05:00
overlay.c
pdt.c
platform.c DeviceTree updates for 4.3: 2015-09-01 19:37:56 -07:00
resolver.c
unittest.c of/unittest: add missing of_node_put 2015-10-22 09:26:28 -05:00