linux/drivers/acpi/arm64
Aleksandr Mishin a11046ea79 acpi/arm64: Adjust error handling procedure in gtdt_parse_timer_block()
[ Upstream commit 1a9de2f6fd ]

In case of error in gtdt_parse_timer_block() invalid 'gtdt_frame'
will be used in 'do {} while (i-- >= 0 && gtdt_frame--);' statement block
because do{} block will be executed even if 'i == 0'.

Adjust error handling procedure by replacing 'i-- >= 0' with 'i-- > 0'.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: a712c3ed9b ("acpi/arm64: Add memory-mapped timer support in GTDT driver")
Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
Acked-by: Hanjun Guo <guohanjun@huawei.com>
Acked-by: Sudeep Holla <sudeep.holla@arm.com>
Acked-by: Aleksandr Mishin <amishin@t-argos.ru>
Link: https://lore.kernel.org/r/20240827101239.22020-1-amishin@t-argos.ru
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-12-05 14:01:13 +01:00
..
agdi.c ACPI: AGDI: Convert to platform remove callback returning void 2024-02-27 15:57:33 +01:00
amba.c ACPI / amba: Drop unnecessary check for registered amba_dummy_clk 2024-06-24 18:36:07 +01:00
apmt.c Merge branches 'for-next/kpti', 'for-next/missing-proto-warn', 'for-next/iss2-decode', 'for-next/kselftest', 'for-next/misc', 'for-next/feat_mops', 'for-next/module-alloc', 'for-next/sysreg', 'for-next/cpucap', 'for-next/acpi', 'for-next/kdump', 'for-next/acpi-doc', 'for-next/doc' and 'for-next/tpidr2-fix', remote-tracking branch 'arm64/for-next/perf' into for-next/core 2023-06-23 18:32:20 +01:00
cpuidle.c arm64: cpuidle: Move ACPI specific code into drivers/acpi/arm64/ 2024-06-13 10:18:40 +01:00
dma.c dma-mapping: Add helpers for dma_range_map bounds 2024-04-26 12:07:24 +02:00
ffh.c arm64: FFH: Move ACPI specific code into drivers/acpi/arm64/ 2024-06-13 10:18:40 +01:00
gtdt.c acpi/arm64: Adjust error handling procedure in gtdt_parse_timer_block() 2024-12-05 14:01:13 +01:00
init.c ACPI: Move AMBA bus scan handling into arm64 specific directory 2023-08-01 13:59:25 +02:00
init.h ACPI: Move AMBA bus scan handling into arm64 specific directory 2023-08-01 13:59:25 +02:00
iort.c ACPI/IORT: Add PMCG platform information for HiSilicon HIP10/11 2024-08-20 14:14:07 +01:00
Kconfig ACPI: ARM Performance Monitoring Unit Table (APMT) initial support 2022-11-07 14:02:11 +00:00
Makefile arm64: FFH: Move ACPI specific code into drivers/acpi/arm64/ 2024-06-13 10:18:40 +01:00
thermal_cpufreq.c ACPI: arm64: export acpi_arch_thermal_cpufreq_pctg() 2023-12-13 13:53:01 +01:00