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

Alex Hung alex.hung at canonical.com
Wed Apr 11 18:49:09 UTC 2018


On 2018-04-10 06:54 AM, Rameshwar Prasad Sahu wrote:
> 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
> 

Acked-by: Alex Hung <alex.hung at canonical.com>



More information about the fwts-devel mailing list