From patchwork Wed Sep 26 07:08:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Hu X-Patchwork-Id: 974876 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42Kptx0PHqz9s55; Wed, 26 Sep 2018 17:08:24 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1g53vo-0002fu-QT; Wed, 26 Sep 2018 07:08:20 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1g53vn-0002fc-B0 for fwts-devel@lists.ubuntu.com; Wed, 26 Sep 2018 07:08:19 +0000 Received: from [175.181.155.235] (helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1g53vm-0002QT-9z; Wed, 26 Sep 2018 07:08:19 +0000 From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH] dmicheck: fix Maximum Capacity checking range Date: Wed, 26 Sep 2018 15:08:11 +0800 Message-Id: <1537945691-27263-1-git-send-email-ivan.hu@canonical.com> X-Mailer: git-send-email 2.7.4 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" 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 Acked-by: Colin Ian King Acked-by: Alex Hung --- 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)