rasdaemon: mce-amd-smca: properly limit bank types
authorAristeu Rozanski <arozansk@redhat.com>
Thu, 19 Jan 2023 13:45:57 +0000 (08:45 -0500)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sat, 21 Jan 2023 06:27:38 +0000 (07:27 +0100)
Found with covscan.

Signed-off-by: Aristeu Rozanski <arozansk@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
mce-amd-smca.c

index f3379fcaddf450168b4f976d5f41ca7cd632926e..27ca8aac50ba491153374563fdebaaffddea91b7 100644 (file)
@@ -584,7 +584,7 @@ static void decode_smca_error(struct mce_event *e)
                return;
        }
 
-       if (bank_type >= MAX_NR_BANKS) {
+       if (bank_type >= N_SMCA_BANK_TYPES) {
                strcpy(e->mcastatus_msg, "Don't know how to decode this bank");
                return;
        }