linux/drivers/of/unittest-data
Christian A. Ehrhardt 4dde835698 of: Fix double free in of_parse_phandle_with_args_map
In of_parse_phandle_with_args_map() the inner loop that
iterates through the map entries calls of_node_put(new)
to free the reference acquired by the previous iteration
of the inner loop. This assumes that the value of "new" is
NULL on the first iteration of the inner loop.

Make sure that this is true in all iterations of the outer
loop by setting "new" to NULL after its value is assigned to "cur".

Extend the unittest to detect the double free and add an additional
test case that actually triggers this path.

Fixes: bd6f2fd5a1 ("of: Support parsing phandle argument lists through a nexus node")
Cc: Stephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: "Christian A. Ehrhardt" <lk@c--e.de>
Link: https://lore.kernel.org/r/20231229105411.1603434-1-lk@c--e.de
Signed-off-by: Rob Herring <robh@kernel.org>
2024-01-09 12:54:02 -06:00
..
Makefile of: overlay: unittest: Add test for unresolved symbol 2023-08-23 20:04:17 -05:00
overlay_0.dtso of: unittest-data: Convert remaining overlay DTS files to sugar syntax 2023-08-23 20:04:17 -05:00
overlay_1.dtso of: unittest-data: Convert remaining overlay DTS files to sugar syntax 2023-08-23 20:04:17 -05:00
overlay_2.dtso of: overlay: rename overlay source files from .dts to .dtso 2022-10-26 09:02:28 -05:00
overlay_3.dtso of: overlay: rename overlay source files from .dts to .dtso 2022-10-26 09:02:28 -05:00
overlay_4.dtso of: unittest-data: Fix whitespace - blank lines 2023-08-23 20:04:17 -05:00
overlay_5.dtso of: overlay: rename overlay source files from .dts to .dtso 2022-10-26 09:02:28 -05:00
overlay_6.dtso of: overlay: rename overlay source files from .dts to .dtso 2022-10-26 09:02:28 -05:00
overlay_7.dtso of: overlay: rename overlay source files from .dts to .dtso 2022-10-26 09:02:28 -05:00
overlay_8.dtso of: overlay: rename overlay source files from .dts to .dtso 2022-10-26 09:02:28 -05:00
overlay_9.dtso of: overlay: rename overlay source files from .dts to .dtso 2022-10-26 09:02:28 -05:00
overlay_10.dtso of: overlay: rename overlay source files from .dts to .dtso 2022-10-26 09:02:28 -05:00
overlay_11.dtso of: unittest-data: Fix whitespace - blank lines 2023-08-23 20:04:17 -05:00
overlay_12.dtso of: unittest-data: Convert remaining overlay DTS files to sugar syntax 2023-08-23 20:04:17 -05:00
overlay_13.dtso of: unittest-data: Convert remaining overlay DTS files to sugar syntax 2023-08-23 20:04:17 -05:00
overlay_15.dtso of: unittest-data: Fix whitespace - blank lines 2023-08-23 20:04:17 -05:00
overlay_16.dtso of: overlay: rename overlay source files from .dts to .dtso 2022-10-26 09:02:28 -05:00
overlay_17.dtso of: overlay: rename overlay source files from .dts to .dtso 2022-10-26 09:02:28 -05:00
overlay_18.dtso of: overlay: rename overlay source files from .dts to .dtso 2022-10-26 09:02:28 -05:00
overlay_19.dtso of: overlay: rename overlay source files from .dts to .dtso 2022-10-26 09:02:28 -05:00
overlay_20.dtso of: overlay: rename overlay source files from .dts to .dtso 2022-10-26 09:02:28 -05:00
overlay_bad_add_dup_node.dtso of: unittest-data: Fix whitespace - angular brackets 2023-08-23 20:04:17 -05:00
overlay_bad_add_dup_prop.dtso of: unittest-data: Fix whitespace - angular brackets 2023-08-23 20:04:17 -05:00
overlay_bad_phandle.dtso of: unittest-data: Fix whitespace - angular brackets 2023-08-23 20:04:17 -05:00
overlay_bad_symbol.dtso of: unittest-data: Fix whitespace - angular brackets 2023-08-23 20:04:17 -05:00
overlay_bad_unresolved.dtso of: overlay: unittest: overlay_bad_unresolved: Spelling s/ok/okay/ 2023-10-27 16:37:42 -05:00
overlay_base.dtso of: overlay: rename overlay source files from .dts to .dtso 2022-10-26 09:02:28 -05:00
overlay_common.dtsi of: unittest-data: Fix whitespace - angular brackets 2023-08-23 20:04:17 -05:00
overlay_gpio_01.dtso of: unittest-data: Fix whitespace - blank lines 2023-08-23 20:04:17 -05:00
overlay_gpio_02a.dtso of: unittest-data: Fix whitespace - blank lines 2023-08-23 20:04:17 -05:00
overlay_gpio_02b.dtso of: unittest-data: Fix whitespace - blank lines 2023-08-23 20:04:17 -05:00
overlay_gpio_03.dtso of: unittest-data: Fix whitespace - blank lines 2023-08-23 20:04:17 -05:00
overlay_gpio_04a.dtso of: unittest-data: Fix whitespace - blank lines 2023-08-23 20:04:17 -05:00
overlay_gpio_04b.dtso of: unittest-data: Fix whitespace - blank lines 2023-08-23 20:04:17 -05:00
overlay_pci_node.dtso of: unittest: Add pci_dt_testdrv pci driver 2023-08-22 14:56:10 -05:00
overlay.dtso of: unittest-data: Fix whitespace - angular brackets 2023-08-23 20:04:17 -05:00
static_base_1.dts
static_base_2.dts
testcases_common.dtsi of: unittest-data: Fix whitespace - blank lines 2023-08-23 20:04:17 -05:00
testcases.dtso of: overlay: rename overlay source files from .dts to .dtso 2022-10-26 09:02:28 -05:00
tests-address.dtsi of: unittest: Add tests for address translations 2023-10-27 16:37:42 -05:00
tests-interrupts.dtsi of: unittest-data: Fix whitespace - blank lines 2023-08-23 20:04:17 -05:00
tests-lifecycle.dtsi of: unittest: add node lifecycle tests 2023-02-20 15:36:51 -06:00
tests-match.dtsi
tests-overlay.dtsi of: unittest-data: Fix whitespace - blank lines 2023-08-23 20:04:17 -05:00
tests-phandle.dtsi of: Fix double free in of_parse_phandle_with_args_map 2024-01-09 12:54:02 -06:00
tests-platform.dtsi