ACK: [PATCH] dmicheck: fix Maximum Capacity checking range

Alex Hung alex.hung at canonical.com
Tue Oct 2 00:10:19 UTC 2018


On 2018-09-26 03:08 PM, Ivan Hu wrote:
> The SMBIOS spec define this field,
> If the capacity is not represented in this field, then
> this field contains 8000 0000h and the Extended
> Maximum Capacity field should be used.
> 
> It allow the value 80000000h, when the Extended
> Maximum Capacity field is used.
> 
> Signed-off-by: Ivan Hu <ivan.hu at canonical.com>
> ---
>  src/dmi/dmicheck/dmicheck.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c
> index d0096bd..ba6f03c 100644
> --- a/src/dmi/dmicheck/dmicheck.c
> +++ b/src/dmi/dmicheck/dmicheck.c
> @@ -1512,7 +1512,7 @@ static void dmicheck_entry(fwts_framework *fw,
>  					data[0x4], table, addr, "Location", 0x4);
>  			dmi_min_max_uint8_check(fw, table, addr, "Use", hdr, 0x5, 0x1, 0x7);
>  			dmi_min_max_uint8_check(fw, table, addr, "Error Corrrection Type", hdr, 0x6, 0x1, 0x7);
> -			dmi_min_max_uint32_check(fw, table, addr, "Maximum Capacity", hdr, 0x7, 0, 0x80000000 - 1);
> +			dmi_min_max_uint32_check(fw, table, addr, "Maximum Capacity", hdr, 0x7, 0, 0x80000000);
>  			if (hdr->length < 0x17)
>  				break;
>  			if (GET_UINT64(data + 0xf) != 0 && GET_UINT32(data + 0x7) != 0x80000000)
> 


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



More information about the fwts-devel mailing list