From patchwork Wed Apr 26 01:49:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lv Zheng X-Patchwork-Id: 9700175 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 5187F60245 for ; Wed, 26 Apr 2017 01:50:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F88B283BA for ; Wed, 26 Apr 2017 01:50:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 335682849A; Wed, 26 Apr 2017 01:50:01 +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 AEB4328497 for ; Wed, 26 Apr 2017 01:50:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1434479AbdDZBt7 (ORCPT ); Tue, 25 Apr 2017 21:49:59 -0400 Received: from mga11.intel.com ([192.55.52.93]:2909 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1434481AbdDZBt7 (ORCPT ); Tue, 25 Apr 2017 21:49:59 -0400 Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Apr 2017 18:49:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,252,1488873600"; d="scan'208";a="93842322" Received: from unknown (HELO Surface-Pro-3.sh.intel.com) ([10.239.159.169]) by fmsmga005.fm.intel.com with ESMTP; 25 Apr 2017 18:49:56 -0700 From: Lv Zheng To: "Rafael J . Wysocki" , "Rafael J . Wysocki" , Len Brown Cc: Lv Zheng , Lv Zheng , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Dan Williams Subject: [RFC PATCH] ACPICA: Tables: Fix regression introduced by a too early mechanism enabling Date: Wed, 26 Apr 2017 09:49:53 +0800 Message-Id: <1493171393-1825-1-git-send-email-lv.zheng@intel.com> X-Mailer: git-send-email 2.7.4 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 In the Linux kernel side, acpi_get_table() hasn't been fully balanced by acpi_put_table() invocations. So it is not a good timing to report errors. The strict balanced validation count check should only be enabled after confirming that all kernel side invocations are safe. Thus this patch removes the fatal error but leaves the error report to indicate the leak so that developers can notice the required engineering change. Reported by Dan Williams, fixed by Lv Zheng. Reported-by: Dan Williams Signed-off-by: Lv Zheng --- drivers/acpi/acpica/tbutils.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c index 5a968a7..9e7d95cf 100644 --- a/drivers/acpi/acpica/tbutils.c +++ b/drivers/acpi/acpica/tbutils.c @@ -422,7 +422,6 @@ acpi_tb_get_table(struct acpi_table_desc *table_desc, "Table %p, Validation count is zero after increment\n", table_desc)); table_desc->validation_count--; - return_ACPI_STATUS(AE_LIMIT); } *out_table = table_desc->pointer;