[PATCH] FWTS: FACS test: Add a check for empty BIOS memory map info list

Rameshwar Prasad Sahu rsahu at apm.com
Tue Apr 10 13:54:34 UTC 2018


FWTS compliance test suit tries to gather the BIOS memory map list
info from the sysfs file called "/sys/firmware/memmap", in case of
failure it retry to get the same from the klog(kernel log). If it
fails here also then we should not check that allocated memory for
FACS structure is reserved or not, because we don't have memory map
info to compare.

This patch fixes this issue by adding a check for empty memory_map_list
before comparing.

Signed-off-by: Rameshwar Prasad Sahu <rsahu at apm.com>
---
 src/lib/src/fwts_memorymap.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/lib/src/fwts_memorymap.c b/src/lib/src/fwts_memorymap.c
index 099d0a9..26750bd 100644
--- a/src/lib/src/fwts_memorymap.c
+++ b/src/lib/src/fwts_memorymap.c
@@ -153,6 +153,10 @@ fwts_bool fwts_memory_map_is_reserved(fwts_list *memory_map_list, const uint64_t
 	if (memory_map_list == NULL)
 		return FWTS_TRUE;

+	/* when we have FWTS_MEMORY_MAP info list empty, then assume all is fair */
+	if (memory_map_list->len == 0)
+		return FWTS_TRUE;
+
 	/* bios data area is always reserved */
 	if ((memory >= 640 * 1024) && (memory <= 1024*1024))
 		return FWTS_TRUE;
--
1.7.1



More information about the fwts-devel mailing list