summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/soc/amd/picasso/mca.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/soc/amd/picasso/mca.c b/src/soc/amd/picasso/mca.c
index ade8c503e0..b03df9004b 100644
--- a/src/soc/amd/picasso/mca.c
+++ b/src/soc/amd/picasso/mca.c
@@ -160,6 +160,11 @@ static const char *const mca_bank_name[] = {
[22] = "PIE",
};
+static bool mca_is_valid_bank(unsigned int bank)
+{
+ return (bank < ARRAY_SIZE(mca_bank_name) && mca_bank_name[bank] != NULL);
+}
+
static void mca_print_error(unsigned int bank)
{
msr_t msr;
@@ -188,6 +193,9 @@ static void mca_check_all_banks(void)
printk(BIOS_WARNING, "CPU has an unexpected number of MCA banks!\n");
for (unsigned int i = 0 ; i < num_banks ; i++) {
+ if (!mca_is_valid_bank(i))
+ continue;
+
mci.bank = i;
mci.sts = rdmsr(MCAX_STATUS_MSR(i));
if (mci.sts.hi || mci.sts.lo) {