From patchwork Mon Aug 21 13:20:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 9912487 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 1D27F602D8 for ; Mon, 21 Aug 2017 13:21:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07F9D28780 for ; Mon, 21 Aug 2017 13:21:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F09D9287A3; Mon, 21 Aug 2017 13:21:21 +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 8114528793 for ; Mon, 21 Aug 2017 13:21:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753870AbdHUNVG (ORCPT ); Mon, 21 Aug 2017 09:21:06 -0400 Received: from mail.skyhub.de ([5.9.137.197]:58494 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753801AbdHUNVD (ORCPT ); Mon, 21 Aug 2017 09:21:03 -0400 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (blast.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id InGscDaHmAPZ; Mon, 21 Aug 2017 15:21:02 +0200 (CEST) Received: from pd.tnic (p2003008C2F216800B50FEF64F44717CE.dip0.t-ipconnect.de [IPv6:2003:8c:2f21:6800:b50f:ef64:f447:17ce]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id EA85E1EC01E2; Mon, 21 Aug 2017 15:21:01 +0200 (CEST) Date: Mon, 21 Aug 2017 15:20:54 +0200 From: Borislav Petkov To: "Rafael J. Wysocki" Cc: Toshi Kani , "Rafael J. Wysocki" , Mauro Carvalho Chehab , Tony Luck , Len Brown , ACPI Devel Maling List , "open list:EDAC-CORE" , Linux Kernel Mailing List Subject: [PATCH] ACPICA: Check whether ACPI is disabled before getting a table Message-ID: <20170821132054.mwhdxkcka4ocp6h5@pd.tnic> References: <20170818194644.14538-1-toshi.kani@hpe.com> <20170818194644.14538-2-toshi.kani@hpe.com> <20170821112657.hrtjoeagxhc67rrr@pd.tnic> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) 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 Borislav Petkov ... and save us the splrinking of this test around in the callers. No functionality change. Signed-off-by: Borislav Petkov --- drivers/acpi/acpica/tbxface.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/acpi/acpica/tbxface.c b/drivers/acpi/acpica/tbxface.c index 010b1c43df92..881b0d5b2838 100644 --- a/drivers/acpi/acpica/tbxface.c +++ b/drivers/acpi/acpica/tbxface.c @@ -226,6 +226,9 @@ acpi_get_table_header(char *signature, u32 j; struct acpi_table_header *header; + if (acpi_disabled) + return (AE_ERROR); + /* Parameter validation */ if (!signature || !out_table_header) {