From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lv Zheng Subject: [PATCH] ACPI / debugger: Fix a redundant mutex unlock issue in acpi_aml_open() Date: Fri, 25 Dec 2015 11:22:32 +0800 Message-ID: <75c5d460bbe5f0d55c442c2d2e144adfc4fe7da2.1451013194.git.lv.zheng@intel.com> References: Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: "Rafael J. Wysocki" , Len Brown Cc: Lv Zheng , Lv Zheng , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org List-Id: linux-acpi@vger.kernel.org Fix a double mutex_unlock() issue where acpi_initialize_debugger() is called with the mutex already unlocked. Reported-by: Dan Carpenter Signed-off-by: Lv Zheng --- drivers/acpi/acpi_dbg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/acpi_dbg.c b/drivers/acpi/acpi_dbg.c index fa18bd0..9c31b08 100644 --- a/drivers/acpi/acpi_dbg.c +++ b/drivers/acpi/acpi_dbg.c @@ -514,7 +514,7 @@ static int acpi_aml_open(struct inode *inode, struct file *file) if (ACPI_FAILURE(status)) { pr_err("Failed to initialize debugger.\n"); ret = -EINVAL; - goto err_lock; + goto err_exit; } pr_debug("Debugger thread initialized.\n"); @@ -531,6 +531,7 @@ err_lock: acpi_aml_active_reader = NULL; } mutex_unlock(&acpi_aml_io.lock); +err_exit: return ret; } -- 1.7.10 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932325AbbLYDW4 (ORCPT ); Thu, 24 Dec 2015 22:22:56 -0500 Received: from mga02.intel.com ([134.134.136.20]:5540 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753343AbbLYDWz (ORCPT ); Thu, 24 Dec 2015 22:22:55 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,476,1444719600"; d="scan'208";a="623456008" From: Lv Zheng To: "Rafael J. Wysocki" , Len Brown Cc: Lv Zheng , Lv Zheng , , linux-acpi@vger.kernel.org Subject: [PATCH] ACPI / debugger: Fix a redundant mutex unlock issue in acpi_aml_open() Date: Fri, 25 Dec 2015 11:22:32 +0800 Message-Id: <75c5d460bbe5f0d55c442c2d2e144adfc4fe7da2.1451013194.git.lv.zheng@intel.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix a double mutex_unlock() issue where acpi_initialize_debugger() is called with the mutex already unlocked. Reported-by: Dan Carpenter Signed-off-by: Lv Zheng --- drivers/acpi/acpi_dbg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/acpi_dbg.c b/drivers/acpi/acpi_dbg.c index fa18bd0..9c31b08 100644 --- a/drivers/acpi/acpi_dbg.c +++ b/drivers/acpi/acpi_dbg.c @@ -514,7 +514,7 @@ static int acpi_aml_open(struct inode *inode, struct file *file) if (ACPI_FAILURE(status)) { pr_err("Failed to initialize debugger.\n"); ret = -EINVAL; - goto err_lock; + goto err_exit; } pr_debug("Debugger thread initialized.\n"); @@ -531,6 +531,7 @@ err_lock: acpi_aml_active_reader = NULL; } mutex_unlock(&acpi_aml_io.lock); +err_exit: return ret; } -- 1.7.10