From patchwork Thu Aug 10 18:06:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongjiu Geng X-Patchwork-Id: 9894399 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0929660384 for ; Thu, 10 Aug 2017 17:43:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBE1D2896E for ; Thu, 10 Aug 2017 17:43:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E05B128B1F; Thu, 10 Aug 2017 17:43:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBDC22896E for ; Thu, 10 Aug 2017 17:43:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752767AbdHJRnW (ORCPT ); Thu, 10 Aug 2017 13:43:22 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:3502 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752737AbdHJRnW (ORCPT ); Thu, 10 Aug 2017 13:43:22 -0400 Received: from 172.30.72.59 (EHLO DGGEMS402-HUB.china.huawei.com) ([172.30.72.59]) by dggrg04-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DEW13088; Fri, 11 Aug 2017 01:43:19 +0800 (CST) Received: from linux.huawei.com (10.67.187.203) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.301.0; Fri, 11 Aug 2017 01:43:06 +0800 From: Dongjiu Geng To: , , , , Subject: [PATCH] acpi: apei: fix the wrongly parse generic error status block Date: Fri, 11 Aug 2017 02:06:52 +0800 Message-ID: <1502388412-20273-1-git-send-email-gengdongjiu@huawei.com> X-Mailer: git-send-email 1.7.7 MIME-Version: 1.0 X-Originating-IP: [10.67.187.203] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.598C9B38.00F0, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 47746a06b677be957a108ebc361c9f12 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The revision 0x300 generic error data entry is different with the old version. when ghes_do_proc traverses to get the data entry, it does not consider this difference. so when error status block has revision 0x300 data entry, it will have issue. Signed-off-by: Dongjiu Geng --- drivers/acpi/apei/apei-internal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/apei/apei-internal.h b/drivers/acpi/apei/apei-internal.h index 6e9f14c0a71b..6491f1c4a96e 100644 --- a/drivers/acpi/apei/apei-internal.h +++ b/drivers/acpi/apei/apei-internal.h @@ -122,8 +122,8 @@ struct dentry *apei_get_debugfs_dir(void); #define apei_estatus_for_each_section(estatus, section) \ for (section = (struct acpi_hest_generic_data *)(estatus + 1); \ - (void *)section - (void *)estatus < estatus->data_length; \ - section = (void *)(section+1) + section->error_data_length) + (void *)section - (void *)(estatus + 1) < estatus->data_length; \ + section = acpi_hest_get_next(section)) static inline u32 cper_estatus_len(struct acpi_hest_generic_status *estatus) {