rasdaemon/SOURCES/e8b97ec14a11764fedfea50bd4d96ddda43c7fc1.patch
2023-03-29 10:58:04 +00:00

25 lines
707 B
Diff

commit e8b97ec14a11764fedfea50bd4d96ddda43c7fc1
Author: Aristeu Rozanski <arozansk@redhat.com>
Date: Thu Jan 19 08:45:57 2023 -0500
rasdaemon: mce-amd-smca: properly limit bank types
Found with covscan.
Signed-off-by: Aristeu Rozanski <arozansk@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
diff --git a/mce-amd-smca.c b/mce-amd-smca.c
index f3379fc..27ca8aa 100644
--- a/mce-amd-smca.c
+++ b/mce-amd-smca.c
@@ -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;
}