soc/amd/cezanne/psp_verstage/uart: Fix off by 1 error

We only allow index = {0, 1}. Fix the check.

BUG=b:215599230
TEST=Build guybrush
BRANCH=guybrush

Found-by: Coverity CID 1469611
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I59615ab39faeded43b3803b4450c84ab8a8b81ba
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61988
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Raul E Rangel 2022-02-15 14:11:36 -07:00 committed by Felix Held
parent fff20212af
commit de66e66517
1 changed files with 1 additions and 1 deletions

View File

@ -10,7 +10,7 @@ uintptr_t get_uart_base(unsigned int idx)
{
uint32_t err;
if (idx > ARRAY_SIZE(uart_bars))
if (idx >= ARRAY_SIZE(uart_bars))
return 0;
if (uart_bars[idx])