From patchwork Mon Feb 4 08:43:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: li guang X-Patchwork-Id: 2089651 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 82F603FC23 for ; Mon, 4 Feb 2013 08:44:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754106Ab3BDIoQ (ORCPT ); Mon, 4 Feb 2013 03:44:16 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:43255 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1753974Ab3BDIoL (ORCPT ); Mon, 4 Feb 2013 03:44:11 -0500 X-IronPort-AV: E=Sophos;i="4.84,598,1355068800"; d="scan'208";a="6686577" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 04 Feb 2013 16:41:55 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id r148i7qV008278; Mon, 4 Feb 2013 16:44:07 +0800 Received: from liguang.fnst.cn.fujitsu.com ([10.167.225.128]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2013020416425276-272212 ; Mon, 4 Feb 2013 16:42:52 +0800 From: liguang To: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, x86@kernel.org Cc: liguang Subject: [PATCH 2/5] acpi/numa: check if parsing acpi numa info disabled earlier Date: Mon, 4 Feb 2013 16:43:43 +0800 Message-Id: <1359967426-32629-3-git-send-email-lig.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1359967426-32629-1-git-send-email-lig.fnst@cn.fujitsu.com> References: <1359967426-32629-1-git-send-email-lig.fnst@cn.fujitsu.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/02/04 16:42:52, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/02/04 16:42:53, Serialize complete at 2013/02/04 16:42:53 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Signed-off-by: liguang --- arch/x86/mm/srat.c | 6 ------ drivers/acpi/numa.c | 2 ++ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/x86/mm/srat.c b/arch/x86/mm/srat.c index a837c95..78c67bd 100644 --- a/arch/x86/mm/srat.c +++ b/arch/x86/mm/srat.c @@ -60,8 +60,6 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa) int pxm, node; int apic_id; - if (srat_disabled()) - return; if (pa->header.length < sizeof(struct acpi_srat_x2apic_cpu_affinity)) { bad_srat(); return; @@ -100,8 +98,6 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa) int pxm, node; int apic_id; - if (srat_disabled()) - return; if (pa->header.length != sizeof(struct acpi_srat_cpu_affinity)) { bad_srat(); return; @@ -148,8 +144,6 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma) u64 start, end; int node, pxm; - if (srat_disabled()) - return -1; if (ma->header.length != sizeof(struct acpi_srat_mem_affinity)) { bad_srat(); return -1; diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c index cb31298..1f51222 100644 --- a/drivers/acpi/numa.c +++ b/drivers/acpi/numa.c @@ -262,6 +262,8 @@ static int __init acpi_parse_srat(struct acpi_table_header *table) struct acpi_table_srat *srat; if (!table) return -EINVAL; + if (srat_disabled()) + return -EACCES; srat = (struct acpi_table_srat *)table; acpi_srat_revision = srat->header.revision;