From patchwork Fri Dec 9 02:21:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lv Zheng X-Patchwork-Id: 9467407 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 C1533607DA for ; Fri, 9 Dec 2016 02:21:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFFF628615 for ; Fri, 9 Dec 2016 02:21:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 98FCE2863B; Fri, 9 Dec 2016 02:21:13 +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 3CF7E28631 for ; Fri, 9 Dec 2016 02:21:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932685AbcLICVL (ORCPT ); Thu, 8 Dec 2016 21:21:11 -0500 Received: from mga11.intel.com ([192.55.52.93]:4590 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932672AbcLICVL (ORCPT ); Thu, 8 Dec 2016 21:21:11 -0500 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 08 Dec 2016 18:21:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,322,1477983600"; d="scan'208";a="1069870568" Received: from lvzheng-z530.sh.intel.com ([10.239.159.165]) by orsmga001.jf.intel.com with ESMTP; 08 Dec 2016 18:21:08 -0800 From: Lv Zheng To: "Rafael J. Wysocki" , "Rafael J. Wysocki" , Len Brown Cc: Lv Zheng , Lv Zheng , , linux-acpi@vger.kernel.org, Dan Williams Subject: [PATCH] ACPI / OSL: Fix a regression by returning table size via acpi_get_table_with_size() Date: Fri, 9 Dec 2016 10:21:04 +0800 Message-Id: X-Mailer: git-send-email 1.7.10 In-Reply-To: References: 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 returned size is still used by the drivers. Reported-by: Dan Williams Cc: Dan Williams Signed-off-by: Lv Zheng --- drivers/acpi/osl.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 5bef0f65..adf1ec4 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -445,8 +445,12 @@ void __ref acpi_os_unmap_memory(void *virt, acpi_size size) status = acpi_get_table(signature, instance, out_table); if (ACPI_SUCCESS(status)) { - /* No longer used by early_acpi_os_unmap_memory() */ - *tbl_size = 0; + /* + * No longer used by early_acpi_os_unmap_memory(), but still + * used by the ACPI table drivers. + */ + if (*out_table) + *tbl_size = (*out_table)->length; } return (status);