From patchwork Fri Oct 11 06:32:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Gong X-Patchwork-Id: 3020961 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2EFB5BF924 for ; Fri, 11 Oct 2013 06:47:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 71AA820333 for ; Fri, 11 Oct 2013 06:47:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AFA96202BE for ; Fri, 11 Oct 2013 06:47:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752345Ab3JKGrm (ORCPT ); Fri, 11 Oct 2013 02:47:42 -0400 Received: from mga01.intel.com ([192.55.52.88]:5130 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753980Ab3JKGrV (ORCPT ); Fri, 11 Oct 2013 02:47:21 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 10 Oct 2013 23:47:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.90,1078,1371106800"; d="scan'208";a="409269235" Received: from gchen-sby.bj.intel.com (HELO localhost) ([10.238.158.212]) by fmsmga001.fm.intel.com with ESMTP; 10 Oct 2013 23:47:19 -0700 From: "Chen, Gong" To: tony.luck@intel.com, bp@alien8.de Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, "Chen, Gong" Subject: [PATCH 1/8] ACPI, APEI, CPER: Fix status check during error printing Date: Fri, 11 Oct 2013 02:32:39 -0400 Message-Id: <1381473166-29303-2-git-send-email-gong.chen@linux.intel.com> X-Mailer: git-send-email 1.8.4.rc3 In-Reply-To: <1381473166-29303-1-git-send-email-gong.chen@linux.intel.com> References: <1381473166-29303-1-git-send-email-gong.chen@linux.intel.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit aaf9d93 only catches condition check before print, but the similar check is needed during printing CPER error sections. Signed-off-by: Chen, Gong Reviewed-by: Borislav Petkov --- drivers/acpi/apei/cper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/apei/cper.c b/drivers/acpi/apei/cper.c index 33dc6a0..f827f02 100644 --- a/drivers/acpi/apei/cper.c +++ b/drivers/acpi/apei/cper.c @@ -353,7 +353,7 @@ void apei_estatus_print(const char *pfx, cper_severity_str(severity)); data_len = estatus->data_length; gdata = (struct acpi_hest_generic_data *)(estatus + 1); - while (data_len > sizeof(*gdata)) { + while (data_len >= sizeof(*gdata)) { gedata_len = gdata->error_data_length; apei_estatus_print_section(pfx, gdata, sec_no); data_len -= gedata_len + sizeof(*gdata);