From bcaa65d5aaf8defeaa36ca9191f54322582d9a95 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 19 Nov 2024 07:51:58 +0100 Subject: [PATCH] ras-page-isolation: fix location_fields size The location_fields is used for both APEI and DSM data. The logic there defines 7 values for APEI and 9 for DSM, but, with the current logic, it allocates only 7 elements. This is likely due to a typo. Fix it. Signed-off-by: Mauro Carvalho Chehab --- ras-page-isolation.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ras-page-isolation.h b/ras-page-isolation.h index 25b02f8..048c72f 100644 --- a/ras-page-isolation.h +++ b/ras-page-isolation.h @@ -75,8 +75,8 @@ enum dsm_location_field_index { DSM_FIELD_NUM }; -#define APEI_FIELD_NUM_CONST (int)APEI_FIELD_NUM -#define DSM_FIELD_NUM_CONST (int)DSM_FIELD_NUM +#define APEI_FIELD_NUM_CONST ((int)APEI_FIELD_NUM) +#define DSM_FIELD_NUM_CONST ((int)DSM_FIELD_NUM) struct memory_location_field { const char *name; @@ -92,7 +92,9 @@ struct page_addr { time_t start; }; -#define ROW_LOCATION_FIELDS_NUM (DSM_FIELD_NUM_CONST > DSM_FIELD_NUM_CONST ? DSM_FIELD_NUM_CONST : APEI_FIELD_NUM_CONST) +#define ROW_LOCATION_FIELDS_NUM ((DSM_FIELD_NUM_CONST > APEI_FIELD_NUM_CONST ? \ + DSM_FIELD_NUM_CONST : APEI_FIELD_NUM_CONST)) + struct row_record { LIST_ENTRY(row_record) entry; LIST_HEAD(page_listhead, page_addr) page_head; -- 2.49.0