coreboot/src
Yu-Ping Wu 1e1b63c23b commonlib/device_tree: Utilize list_move() in dt_copy_subtree()
In dt_copy_subtree(), the device_tree_node copying

 *dst_node = *src_node;

doesn't work correctly for circular linked lists [1], because the 'next'
pointer of the last element isn't modified to point to the dst head.

As the only public caller of dt_copy_subtree() is dt_apply_overlay(),
and the dt_apply_overlay() function comment already explicitly disallows
'overlay' accesses after the call, fix the problem by utilizing
list_move() for copying device tree node properties and children.

Also add a new test case test_dt_apply_overlay.

[1] commit 23c41622a9 ("commonlib/list: Change to circular list")

BUG=b:434080284
TEST=emerge-rauru coreboot libpayload
BRANCH=none

Change-Id: I166ab74c9de67330d52f94e92b5d7ce5ddefa82b
Signed-off-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/91558
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Jakub "Kuba" Czapiga <czapiga@google.com>
2026-03-07 01:19:35 +00:00
..
acpi acpi/dsdt_top.asl: Move RBUF out of the _CRS method 2026-02-09 15:20:48 +00:00
arch treewide: Move check-ramstage-overlap variables 2026-02-11 20:00:57 +00:00
commonlib commonlib/device_tree: Utilize list_move() in dt_copy_subtree() 2026-03-07 01:19:35 +00:00
console console: Fix flushing for slow consoles 2025-10-02 22:44:46 +00:00
cpu haswell/broadwell: Move CPU bus ops to CPU code 2026-03-04 16:46:52 +00:00
device dram/ddr3: Add speed in MT/s 2026-02-19 19:20:43 +00:00
drivers drivers/usb/acpi: Add DSM function 3 support for Intel Bluetooth 2026-02-28 15:05:45 +00:00
ec starlabs: drop CMOS option tables 2026-03-04 09:25:46 +00:00
include lib: Rename devtree_update to mb_devtree_update 2026-03-06 20:33:48 +00:00
lib lib: Rename devtree_update to mb_devtree_update 2026-03-06 20:33:48 +00:00
mainboard lib: Rename devtree_update to mb_devtree_update 2026-03-06 20:33:48 +00:00
northbridge nb/intel/broadwell/acpi.c: Use Haswell's file 2026-03-04 16:49:22 +00:00
sbom
security soc/intel/common: Add opt-in runtime control for BIOS SMM write 2026-01-29 14:41:46 +00:00
soc soc/intel/pantherlake: Keep default values for TdcTimeWindow 2026-03-05 17:55:03 +00:00
southbridge sb/intel/wildcatpoint/pcie.c: Reorder some steps 2026-03-06 20:06:58 +00:00
superio sio/nuvoton/nct6776: Switch to common init code 2026-02-19 19:19:43 +00:00
vendorcode vc/chromeos: Provide inline fallbacks for Chromebook Plus branding 2026-03-03 03:18:46 +00:00
Kconfig Kconfig: Add Kconfig for signed secure blobs 2026-03-03 03:17:57 +00:00