kernel_optimize_test/drivers/of
Geert Uytterhoeven 5e4748175f of: overlay: Fix (un)locking in of_overlay_apply()
The special overlay mutex is taken first, hence it should be released
last in the error path.

of_resolve_phandles() must be called with of_mutex held.  Without it, a
node and new phandle could be added via of_attach_node(), making the max
phandle wrong.

free_overlay_changeset() must be called with of_mutex held, if any
non-trivial cleanup is to be done.

Hence move "mutex_lock(&of_mutex)" up, as suggested by Frank, and merge
the two tail statements of the success and error paths, now they became
identical.

Note that while the two mutexes are adjacent, we still need both:
__of_changeset_apply_notify(), which is called by __of_changeset_apply()
unlocks of_mutex, then does notifications then locks of_mutex.  So the
mutex get released in the middle of of_overlay_apply()

Fixes: f948d6d8b7 ("of: overlay: avoid race condition between applying multiple overlays")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Frank Rowand <frank.rowand@sony.com>
Signed-off-by: Rob Herring <robh@kernel.org>
2017-12-06 16:08:30 -06:00
..
unittest-data DeviceTree fixes for 4.15: 2017-11-20 21:38:41 -10:00
address.c of/pci: Add of_pci_dma_range_parser_init() for dma-ranges parsing support 2017-10-05 15:52:34 -05:00
base.c DeviceTree fixes for 4.15: 2017-11-20 21:38:41 -10:00
device.c drivers: flag buses which demand DMA configuration 2017-10-19 16:34:52 +02:00
dynamic.c of: Spelling s/changset/changeset/ 2017-12-06 14:56:32 -06:00
fdt_address.c of: use pr_fmt prefix for all console printing 2016-07-18 16:57:42 -05:00
fdt.c of/fdt: Document detached argument to __unflatten_device_tree() 2017-10-16 16:49:18 -05:00
irq.c DeviceTree updates for 4.14: 2017-09-07 14:43:33 -07:00
Kconfig of: make kobject and bin_attribute support configurable 2017-10-16 13:37:38 -05:00
kobj.c of: make kobject and bin_attribute support configurable 2017-10-16 13:37:38 -05:00
Makefile DeviceTree for 4.15: 2017-11-14 18:25:40 -08:00
of_mdio.c of_mdio: Fix broken PHY IRQ in case of probe deferral 2017-10-22 03:20:25 +01:00
of_net.c
of_numa.c of: fix "/cpus" reference leak in of_numa_parse_cpu_nodes() 2017-04-18 11:04:12 -05:00
of_pci_irq.c OF/PCI: Update of_irq_parse_and_map_pci() comment 2017-07-02 16:14:28 -05:00
of_pci.c of/pci: Fix theoretical NULL dereference 2017-11-16 11:01:14 -06:00
of_private.h of: overlay: remove a dependency on device node full_name 2017-10-17 20:47:37 -05:00
of_reserved_mem.c ARM: SoC driver updates for v4.15 2017-11-16 16:05:01 -08:00
overlay.c of: overlay: Fix (un)locking in of_overlay_apply() 2017-12-06 16:08:30 -06:00
pdt.c
platform.c soc: qcom: Remote filesystem memory driver 2017-10-22 05:06:34 -05:00
property.c device property: Make fwnode_handle_get() return the fwnode 2017-11-09 00:17:22 +01:00
resolver.c of: overlay: avoid race condition between applying multiple overlays 2017-10-17 20:47:27 -05:00
unittest.c of: unittest: Remove bogus overlay mutex release from overlay_data_add() 2017-12-06 14:56:32 -06:00