linux/drivers/of
Herve Codina d7dfa7fde6 of: Fix error path in of_parse_phandle_with_args_map()
The current code uses some 'goto put;' to cancel the parsing operation
and can lead to a return code value of 0 even on error cases.

Indeed, some goto calls are done from a loop without setting the ret
value explicitly before the goto call and so the ret value can be set to
0 due to operation done in previous loop iteration. For instance match
can be set to 0 in the previous loop iteration (leading to a new
iteration) but ret can also be set to 0 it the of_property_read_u32()
call succeed. In that case if no match are found or if an error is
detected the new iteration, the return value can be wrongly 0.

Avoid those cases setting the ret value explicitly before the goto
calls.

Fixes: bd6f2fd5a1 ("of: Support parsing phandle argument lists through a nexus node")
Cc: stable@vger.kernel.org
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://lore.kernel.org/r/20241202165819.158681-1-herve.codina@bootlin.com
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
2024-12-03 11:31:19 -06:00
..
unittest-data of/unittest: Add empty dma-ranges address translation tests 2024-11-27 09:18:04 -06:00
.kunitconfig of: Allow overlay kunit tests to run CONFIG_OF_OVERLAY=n 2024-11-15 14:03:28 -06:00
Kconfig of: Allow overlay kunit tests to run CONFIG_OF_OVERLAY=n 2024-11-15 14:03:28 -06:00
Makefile of: Add a KUnit test for overlays and test managed APIs 2024-07-29 15:33:12 -07:00
address.c of: address: Preserve the flags portion on 1:1 dma-ranges mapping 2024-11-27 09:18:04 -06:00
base.c of: Fix error path in of_parse_phandle_with_args_map() 2024-12-03 11:31:19 -06:00
cpu.c of: Constify struct device_node function arguments 2024-10-15 08:58:36 -05:00
device.c OF: Simplify of_iommu_configure() 2024-07-04 14:36:04 +01:00
dynamic.c of: Constify of_changeset_entry function arguments 2024-10-15 08:58:36 -05:00
empty_root.dts of: Add #address-cells/#size-cells in the device-tree root empty node 2024-12-02 09:26:33 -06:00
fdt.c of: WARN on deprecated #address-cells/#size-cells handling 2024-11-08 13:15:54 -06:00
fdt_address.c of/fdt: Don't use default address cell sizes for address translation 2024-11-08 13:15:54 -06:00
irq.c of: Constify struct device_node function arguments 2024-10-15 08:58:36 -05:00
kexec.c of/fdt: add dt_phys arg to early_init_dt_scan and early_init_dt_verify 2024-10-29 15:32:45 -05:00
kobj.c of: Constify safe_name() kobject arg 2024-10-15 08:58:36 -05:00
kunit_overlay_test.dtso of: Add a KUnit test for overlays and test managed APIs 2024-07-29 15:33:12 -07:00
module.c of: module: remove strlen() call in of_modalias() 2024-10-16 12:00:10 -05:00
of_kunit_helpers.c of: Skip kunit tests when arm64+ACPI doesn't populate root node 2024-10-10 12:43:01 -05:00
of_numa.c of:of_numa: remove unused macro 2024-10-08 09:47:30 -05:00
of_private.h Merge branch 'dt/linus' into dt/next 2024-11-15 14:03:59 -06:00
of_reserved_mem.c of: reserved_mem: Add code to dynamically allocate reserved_mem array 2024-10-15 10:34:33 -05:00
of_test.c of: Skip kunit tests when arm64+ACPI doesn't populate root node 2024-10-10 12:43:01 -05:00
overlay.c of: Constify struct property pointers 2024-10-15 08:58:36 -05:00
overlay_test.c of: Allow overlay kunit tests to run CONFIG_OF_OVERLAY=n 2024-11-15 14:03:28 -06:00
pdt.c of: Remove struct device_node.type pointer 2019-01-10 16:24:44 -06:00
platform.c The core clk framework is left largely untouched this time around except for 2024-09-23 15:01:48 -07:00
property.c of: property: fw_devlink: Do not use interrupt-parent directly 2024-11-25 08:24:17 -06:00
resolver.c of: Constify struct property pointers 2024-10-15 08:58:36 -05:00
unittest.c of/unittest: Add empty dma-ranges address translation tests 2024-11-27 09:18:04 -06:00