From patchwork Wed Mar 18 03:14:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 45917 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 70EFA21547 for ; Wed, 18 Mar 2015 03:15:43 +0000 (UTC) Received: by wivz2 with SMTP id z2sf5419329wiv.1 for ; Tue, 17 Mar 2015 20:15:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=wTLUEpK246SEC+UqebuwOUTK61yEdHrJ+etoJN1iS5U=; b=a1oz2nCRYW7vtvvkHVhJhhcr7LKkybT8kwpDMw2vxL22DyrRpf7BfblIEWALE0/dZk Tuwgii5iiJuWOxt1UfTv98nijdH9juK2W52iaZLCCOtu1wI61xEnhMCcxhHkevs0IufV SlbqIOmGdHfJo+PFYekXAxIYDGiiiOt4ZViZG6artfSeIivNZRpy0FzLgviiyYbnujgc dE3D6HuUpygq+BdZUU8BDgnt6DfrlpK7AoHHYsuF+LHWpOQQJvnbb7+AeKODlPwwYEto uEKthRrKtJRlKocuEct7W8lfoaYGAW/1PKNkLQzYdzdgFOaa+scoN9lqgha4mK2rvwA5 +5OQ== X-Gm-Message-State: ALoCoQm9RSGkfWHxrK6cSnG4l5eWux5KeZTr/P0CXOw5xCWaYKxyTse8t2itQyJDVnrCqT0giurd X-Received: by 10.180.80.35 with SMTP id o3mr1019074wix.0.1426648542700; Tue, 17 Mar 2015 20:15:42 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.205.99 with SMTP id lf3ls109252lac.4.gmail; Tue, 17 Mar 2015 20:15:42 -0700 (PDT) X-Received: by 10.112.173.41 with SMTP id bh9mr61579855lbc.107.1426648542302; Tue, 17 Mar 2015 20:15:42 -0700 (PDT) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id ac10si11925668lbc.6.2015.03.17.20.15.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Mar 2015 20:15:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by lamx15 with SMTP id x15so25292486lam.3 for ; Tue, 17 Mar 2015 20:15:42 -0700 (PDT) X-Received: by 10.152.28.5 with SMTP id x5mr61444438lag.112.1426648542134; Tue, 17 Mar 2015 20:15:42 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp894169lbj; Tue, 17 Mar 2015 20:15:41 -0700 (PDT) X-Received: by 10.70.102.101 with SMTP id fn5mr135910347pdb.131.1426648521878; Tue, 17 Mar 2015 20:15:21 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id nt3si33087408pdb.180.2015.03.17.20.15.21; Tue, 17 Mar 2015 20:15:21 -0700 (PDT) Received-SPF: none (google.com: stable-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932668AbbCRDPS (ORCPT + 1 other); Tue, 17 Mar 2015 23:15:18 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:18045 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932560AbbCRDPQ (ORCPT ); Tue, 17 Mar 2015 23:15:16 -0400 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t2I3FEj7003014 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 18 Mar 2015 03:15:14 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t2I3FDoR022449 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 18 Mar 2015 03:15:13 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t2I3FC9W007412; Wed, 18 Mar 2015 03:15:12 GMT Received: from lappy.hsd1.nh.comcast.net (/10.154.120.23) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 17 Mar 2015 20:15:12 -0700 From: Sasha Levin To: stable@vger.kernel.org, stable-commits@vger.kernel.org Cc: Ivan Khoronzhuk , Matt Fleming , Sasha Levin Subject: [added to the 3.18 stable tree] firmware: dmi_scan: Fix dmi scan to handle "End of Table" structure Date: Tue, 17 Mar 2015 23:14:08 -0400 Message-Id: <1426648483-4376-12-git-send-email-sasha.levin@oracle.com> X-Mailer: git-send-email 2.1.0 X-Source-IP: acsinet21.oracle.com [141.146.126.237] Sender: stable-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: stable@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Ivan Khoronzhuk This patch has been added to the 3.18 stable tree. If you have any objections, please let us know. =============== [ Upstream commit ce204e9a4bd82e9e6e7479bca8057e45aaac5c42 ] The dmi-sysfs should create "End of Table" entry, that is type 127. But after adding initial SMBIOS v3 support fc43026278b2 ("dmi: add support for SMBIOS 3.0 64-bit entry point") the 127-0 entry is not handled any more, as result it's not created in dmi sysfs for instance. This is important because the size of whole DMI table must correspond to sum of all DMI entry sizes. So move the end-of-table check after it's handled by dmi_table. Reviewed-by: Ard Biesheuvel Signed-off-by: Ivan Khoronzhuk Signed-off-by: Matt Fleming Signed-off-by: Sasha Levin --- drivers/firmware/dmi_scan.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index 84bc2a5..3a53c36 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c @@ -102,6 +102,13 @@ static void dmi_table(u8 *buf, u32 len, int num, data++; if (data - buf < len - 1) decode(dm, private_data); + + /* + * 7.45 End-of-Table (Type 127) [SMBIOS reference spec v3.0.0] + */ + if (dm->type == DMI_ENTRY_END_OF_TABLE) + break; + data += 2; i++; }