linux/drivers/of
Geert Uytterhoeven a9515ff4fb of: overlay: Call of_changeset_init() early
When of_overlay_fdt_apply() fails, the changeset may be partially
applied, and the caller is still expected to call of_overlay_remove() to
clean up this partial state.

However, of_overlay_apply() calls of_resolve_phandles() before
init_overlay_changeset().  Hence if the overlay fails to apply due to an
unresolved symbol, the overlay_changeset.cset.entries list is still
uninitialized, and cleanup will crash with a NULL-pointer dereference in
overlay_removal_is_ok().

Fix this by moving the call to of_changeset_init() from
init_overlay_changeset() to of_overlay_fdt_apply(), where all other
early initialization is done.

Fixes: f948d6d8b7 ("of: overlay: avoid race condition between applying multiple overlays")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/4f1d6d74b61cba2599026adb6d1948ae559ce91f.1690533838.git.geert+renesas@glider.be
Signed-off-by: Rob Herring <robh@kernel.org>
2023-08-23 20:04:17 -05:00
..
unittest-data of: unittest: Add pci_dt_testdrv pci driver 2023-08-22 14:56:10 -05:00
address.c dma-mapping updates for Linux 6.4 2023-04-29 10:29:57 -07:00
base.c of: Refactor node and property manipulation function locking 2023-08-21 17:09:57 -05:00
cpu.c of: Move CPU node related functions to their own file 2023-04-13 17:46:34 -05:00
device.c of: Move of_device_{add,register,unregister} to platform.c 2023-08-04 11:36:33 -06:00
dynamic.c of: dynamic: Add interfaces for creating device node dynamically 2023-08-22 14:56:09 -05:00
fdt_address.c
fdt.c Devicetree fixes for 6.4, part 1: 2023-05-05 13:27:59 -07:00
irq.c of/irq: add missing of_node_put() for interrupt parent node 2023-01-18 11:31:42 -06:00
Kconfig of: make OF_EARLY_FLATTREE depend on HAS_IOMEM 2023-07-10 08:48:35 -06:00
kexec.c mm,ima,kexec,of: use memblock_free_late from ima_free_kexec_buffer 2023-08-18 11:47:45 -05:00
kobj.c of: make of_node_ktype constant 2023-02-06 11:03:00 -06:00
Makefile Char/Misc drivers for 6.4-rc1 2023-04-27 12:07:50 -07:00
module.c of: Move the request module helper logic to module.c 2023-04-05 19:41:10 +02:00
of_numa.c of, numa: Fetch empty NUMA node ID from distance map 2021-10-04 13:13:44 -05:00
of_private.h of: Move of_platform_register_reconfig_notifier() into DT core 2023-08-04 11:36:33 -06:00
of_reserved_mem.c of: reserved_mem: Use stable allocation order 2023-06-20 09:34:58 -06:00
overlay.c of: overlay: Call of_changeset_init() early 2023-08-23 20:04:17 -05:00
pdt.c of: Remove struct device_node.type pointer 2019-01-10 16:24:44 -06:00
platform.c of: Move of_skipped_node_table within #ifdef CONFIG_OF_ADDRESS 2023-08-22 12:53:11 -05:00
property.c Devicetree updates for v6.3: 2023-02-24 13:31:53 -08:00
resolver.c of: overlay: log the error cause on resolver failure 2020-03-02 11:32:44 -06:00
unittest.c of: unittest: Check tree matches original after reverting a changeset 2023-08-23 20:04:17 -05:00