linux/drivers/acpi/arm64
Aleksandr Mishin 01f605a4cd 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-09 10:31:44 +01:00
..
agdi.c ACPI: bus: Consolidate all arm specific initialisation into acpi_arm_init() 2023-06-08 08:07:51 +01:00
amba.c Char/Misc driver changes for 6.6-rc1 2023-09-01 09:53:54 -07: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
dma.c ACPI: scan: Support multiple DMA windows with different offsets 2022-09-24 18:39:21 +02:00
gtdt.c acpi/arm64: Adjust error handling procedure in gtdt_parse_timer_block() 2024-12-09 10:31:44 +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 arm64 updates for 6.6 2023-08-28 17:34:54 -07:00
Kconfig ACPI: ARM Performance Monitoring Unit Table (APMT) initial support 2022-11-07 14:02:11 +00:00
Makefile ACPI: Move AMBA bus scan handling into arm64 specific directory 2023-08-01 13:59:25 +02:00