OpenCloudOS-Kernel/drivers/of
Amitoj Kaur Chawla 82f68756e9 of: resolver: Add missing of_node_get and of_node_put
In __of_find_node_by_full_name, add an of_node_get when detecting the
desired element, to ensure that it ends up with a reference count that is
one greater than on entering the function.

Also in __of_find_node_by_full_name, add an of_node_put on breaking
out of the for_each_child_of_node loop, to ensure that the reference
count of the returned value is not double incremented. This change
was made using Coccinelle.

The semantic patch used for this is as follows:

// <smpl>
@@
expression e;
local idexpression n;
@@

 for_each_child_of_node(..., n) {
   ... when != of_node_put(n)
       when != e = n
(
   return n;
|
+  of_node_put(n);
?  return ...;
)
   ...
 }
// </smpl

Finally, add an of_node_put in for_each_child_of_node in the function
__of_adjust_phandle_ref after the value returned by
__of_find_node_by_full_name is no longer useful.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
2016-02-13 13:35:32 -06:00
..
unittest-data of/unittest: replace 'selftest' with 'unittest' 2015-03-25 00:53:29 -05:00
Kconfig of: add config option to enable building of all dtbs 2015-10-27 16:12:13 -05:00
Makefile of: clean-up unnecessary libfdt include paths 2015-06-04 20:16:47 -05:00
address.c DeviceTree updates for 4.5: 2016-01-14 11:13:28 -08:00
base.c of: simplify arch_find_n_match_cpu_physical_id() function 2015-10-30 13:04:19 -05:00
device.c of: to support binding numa node to specified device in devicetree 2015-10-17 22:11:50 -07:00
dynamic.c drivers/of: Export OF changeset functions 2016-01-13 16:10:37 -06:00
fdt.c of/fdt: Add mutex protection for calls to __unflatten_device_tree() 2015-12-08 09:50:42 -06:00
fdt_address.c of/fdt: add FDT address translation support 2014-05-20 15:19:25 -05:00
irq.c DeviceTree updates for 4.5: 2016-01-14 11:13:28 -08:00
of_mdio.c mdio: remove an unneed condition 2016-01-12 11:51:57 -05:00
of_mtd.c of_mtd: Add helpers to get ECC strength and ECC step size 2014-03-10 22:42:28 -07:00
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 More power management and ACPI updates for v4.4-rc1 2015-11-12 11:50:33 -08: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 drivers/of: Export OF changeset functions 2016-01-13 16:10:37 -06:00
of_reserved_mem.c of: Fix comparison of reserved memory regions 2015-11-30 17:56:44 -06:00
overlay.c drivers/of: Export OF changeset functions 2016-01-13 16:10:37 -06:00
pdt.c of: Eliminate of_allnodes list 2014-11-04 13:29:38 +00:00
platform.c of/platform: export of_default_bus_match_table 2016-01-05 09:20:44 -06:00
resolver.c of: resolver: Add missing of_node_get and of_node_put 2016-02-13 13:35:32 -06:00
unittest.c drivers/of: Export OF changeset functions 2016-01-13 16:10:37 -06:00