alistair23-linux/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 of/unittest: replace 'selftest' with 'unittest' 2015-03-25 00:53:29 -05:00
address.c PCI: of: Add 64-bit address recognition without LPAE support 2015-10-13 13:30:37 -05:00
base.c Devicetree changes for v4.2 2015-07-01 19:40:18 -07:00
device.c of: to support binding numa node to specified device in devicetree 2015-09-17 14:51:55 -05:00
dynamic.c of/dynamic: Fix test for PPC_PSERIES 2015-06-05 10:39:28 +09:00
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
Kconfig of: add HAS_IOMEM depends to OF_ADDRESS 2015-07-27 08:21:04 -05:00
Makefile of: clean-up unnecessary libfdt include paths 2015-06-04 20:16:47 -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_net: factor out repetitive code from of_get_mac_address() 2015-03-29 08:56:17 +01:00
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: Refactor __of_node_alloc() into __of_node_dup() 2014-11-24 22:24:41 +00:00
of_reserved_mem.c of: Check for overlap in reserved memory regions 2015-09-17 14:52:06 -05:00
overlay.c of/overlay: Grammar s/an negative/a negative/ 2015-05-28 13:00:25 -05:00
pdt.c
platform.c DeviceTree updates for 4.3: 2015-09-01 19:37:56 -07:00
resolver.c of/resolver: Switch to new local fixups format. 2014-11-24 22:24:50 +00:00
unittest.c of/unittest: add missing of_node_put 2015-10-22 09:26:28 -05:00