From 404aea866ce60af9f8756f0698dcd8293c0e81bf Mon Sep 17 00:00:00 2001 From: Felix Held Date: Tue, 2 Feb 2021 23:46:25 +0100 Subject: amd/common/block/acpi/pm_state: fix comparison in get_index_bit In the case of passing 32 as limit the code returned -1, but should have continued, since 32 is a valid value here. Signed-off-by: Felix Held Change-Id: I6ca341841bad62abcb4ea26a350c539813a29de7 Reviewed-on: https://review.coreboot.org/c/coreboot/+/50243 Tested-by: build bot (Jenkins) Reviewed-by: Raul Rangel --- src/soc/amd/common/block/acpi/pm_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/soc/amd/common/block/acpi/pm_state.c b/src/soc/amd/common/block/acpi/pm_state.c index a0097185dc..05bb927826 100644 --- a/src/soc/amd/common/block/acpi/pm_state.c +++ b/src/soc/amd/common/block/acpi/pm_state.c @@ -13,7 +13,7 @@ static int get_index_bit(uint32_t value, uint16_t limit) uint16_t i; uint32_t t; - if (limit >= TOTAL_BITS(uint32_t)) + if (limit > TOTAL_BITS(uint32_t)) return -1; /* get a mask of valid bits. Ex limit = 3, set bits 0-2 */ -- cgit v1.2.3