linux-yocto/drivers/base
Dan Carpenter 73b8f31337 pmdomain: core: Fix error checking in genpd_dev_pm_attach_by_id()
[ Upstream commit 0f5757667ec0aaf2456c3b76fcf0c6c3ea3591fe ]

The error checking for of_count_phandle_with_args() does not handle
negative error codes correctly.  The problem is that "index" is a u32 so
in the condition "if (index >= num_domains)" negative error codes stored
in "num_domains" are type promoted to very high positive values and
"index" is always going to be valid.

Test for negative error codes first and then test if "index" is valid.

Fixes: 3ccf3f0cd1 ("PM / Domains: Enable genpd_dev_pm_attach_by_id|name() for single PM domain")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/aBxPQ8AI8N5v-7rL@stanley.mountain
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-06-19 15:28:36 +02:00
..
firmware_loader firmware_loader: Fix possible resource leak in fw_log_firmware_info() 2024-12-09 10:32:37 +01:00
power pmdomain: core: Fix error checking in genpd_dev_pm_attach_by_id() 2025-06-19 15:28:36 +02:00
regmap regmap-irq: Add missing kfree() 2025-02-21 13:57:19 +01:00
test
arch_numa.c arm64: irq: set the correct node for VMAP stack 2024-02-05 20:14:14 +00:00
arch_topology.c
attribute_container.c
auxiliary.c
base.h driver core: fix potential NULL pointer dereference in dev_uevent() 2025-05-02 07:51:03 +02:00
bus.c driver core: fix potential NULL pointer dereference in dev_uevent() 2025-05-02 07:51:03 +02:00
cacheinfo.c cacheinfo: Allocate memory during CPU hotplug if not done from the primary CPU 2024-12-14 19:59:55 +01:00
class.c driver core: class: Fix wild pointer dereferences in API class_dev_iter_next() 2025-02-08 09:52:27 +01:00
component.c
container.c
core.c driver core: fix potential NULL pointer dereference in dev_uevent() 2025-05-02 07:51:03 +02:00
cpu.c x86/its: Enable Indirect Target Selection mitigation 2025-05-18 08:24:11 +02:00
dd.c driver core: introduce device_set_driver() helper 2025-05-02 07:51:03 +02:00
devcoredump.c devcoredump: Send uevent once devcd is ready 2023-12-13 18:45:33 +01:00
devres.c drivers: base: devres: Allow to release group on device release 2025-04-25 10:45:18 +02:00
devtmpfs.c
driver.c
firmware.c
hypervisor.c
init.c
isa.c
Kconfig
Makefile
map.c
memory.c mm/memory_hotplug: add missing mem_hotplug_lock 2023-12-13 18:45:24 +01:00
module.c drivers: base: handle module_kobject creation 2025-05-09 09:44:07 +02:00
node.c base/node.c: initialize the accessor list before registering 2024-01-25 15:35:51 -08:00
physical_location.c
physical_location.h
pinctrl.c
platform-msi.c
platform.c
property.c
soc.c
swnode.c software node: Let args be NULL in software_node_get_reference_args 2024-01-25 15:35:51 -08:00
syscore.c
topology.c topology: Keep the cpumask unchanged when printing cpumap 2025-01-17 13:36:20 +01:00
trace.c
trace.h
transport_class.c