From patchwork Tue Mar 12 15:43:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 2256941 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 714ABDF23A for ; Tue, 12 Mar 2013 15:43:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932310Ab3CLPni (ORCPT ); Tue, 12 Mar 2013 11:43:38 -0400 Received: from mail-ie0-f169.google.com ([209.85.223.169]:45864 "EHLO mail-ie0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932148Ab3CLPnh (ORCPT ); Tue, 12 Mar 2013 11:43:37 -0400 Received: by mail-ie0-f169.google.com with SMTP id 13so6674134iea.28 for ; Tue, 12 Mar 2013 08:43:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:subject:from:to:cc:date:in-reply-to :references:content-type:x-mailer:content-transfer-encoding :mime-version:x-gm-message-state; bh=NisdgaD54CdzL9UjEJjDzrcsGrzDR1xBJ06/3uoSMK0=; b=Xg+w+ZVeJT8vHgFb1v3lbAG0GM0iow/Hh8S+FEw1uopYUsvBYs3QwxbJl1r+w07Ey6 KTRKBjevWO2IY6DZafhRPHt6ZIL4CmSzHFD3hJ7tWOM7nVdKX4m5sKlghqGnAENOKW/f +HlpAYnTChTC5toBsWrOR4yJ8oWZJONP7lk71yyo/BbzRrdVhQQ/qQK3VOUdhb+/43K9 sDI7TsKIT1Usv1O2PW5459JtRAytrI9FyjyT6ZWw+W0XByhzutgNWH0aSkHHJ3qjt5KB f9h/7ArBBif42FzjSS8PuuiATSHtisUNqJfUHjWLx2sidEEr5VxrkVqvhslYj1e5BAWd 1rxg== X-Received: by 10.50.140.67 with SMTP id re3mr11824296igb.100.1363103016947; Tue, 12 Mar 2013 08:43:36 -0700 (PDT) Received: from [192.168.0.102] (114-39-104-58.dynamic.hinet.net. [114.39.104.58]) by mx.google.com with ESMTPS id vb15sm21980845igb.9.2013.03.12.08.43.32 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Mar 2013 08:43:35 -0700 (PDT) Message-ID: <1363103009.3160.3.camel@phoenix> Subject: [PATCH 2/2] thermal: db8500: Fix missing mutex_unlock() in probe error paths From: Axel Lin To: Zhang Rui Cc: Hongbo Zhang , Viresh Kumar , Francesco Lavra , linux-pm@vger.kernel.org Date: Tue, 12 Mar 2013 23:43:29 +0800 In-Reply-To: <1363102940.3160.2.camel@phoenix> References: <1363102940.3160.2.camel@phoenix> X-Mailer: Evolution 3.2.3-0ubuntu6 Mime-Version: 1.0 X-Gm-Message-State: ALoCoQm7tvTXbZHFLpggusPMcQN0iqphyAKW5Vu8N6of8IWZg7JwzcS10lU9C2n7xQ1DZJElBgjI Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Signed-off-by: Axel Lin --- drivers/thermal/db8500_thermal.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/thermal/db8500_thermal.c b/drivers/thermal/db8500_thermal.c index 6bdcec4..1e3b3bf 100644 --- a/drivers/thermal/db8500_thermal.c +++ b/drivers/thermal/db8500_thermal.c @@ -419,7 +419,8 @@ static int db8500_thermal_probe(struct platform_device *pdev) low_irq = platform_get_irq_byname(pdev, "IRQ_HOTMON_LOW"); if (low_irq < 0) { dev_err(&pdev->dev, "Get IRQ_HOTMON_LOW failed.\n"); - return low_irq; + ret = low_irq; + goto out_unlock; } ret = devm_request_threaded_irq(&pdev->dev, low_irq, NULL, @@ -427,13 +428,14 @@ static int db8500_thermal_probe(struct platform_device *pdev) "dbx500_temp_low", pzone); if (ret < 0) { dev_err(&pdev->dev, "Failed to allocate temp low irq.\n"); - return ret; + goto out_unlock; } high_irq = platform_get_irq_byname(pdev, "IRQ_HOTMON_HIGH"); if (high_irq < 0) { dev_err(&pdev->dev, "Get IRQ_HOTMON_HIGH failed.\n"); - return high_irq; + ret = high_irq; + goto out_unlock; } ret = devm_request_threaded_irq(&pdev->dev, high_irq, NULL, @@ -441,7 +443,7 @@ static int db8500_thermal_probe(struct platform_device *pdev) "dbx500_temp_high", pzone); if (ret < 0) { dev_err(&pdev->dev, "Failed to allocate temp high irq.\n"); - return ret; + goto out_unlock; } pzone->therm_dev = thermal_zone_device_register("db8500_thermal_zone", @@ -449,7 +451,8 @@ static int db8500_thermal_probe(struct platform_device *pdev) if (IS_ERR(pzone->therm_dev)) { dev_err(&pdev->dev, "Register thermal zone device failed.\n"); - return PTR_ERR(pzone->therm_dev); + ret = PTR_ERR(pzone->therm_dev); + goto out_unlock; } dev_info(&pdev->dev, "Thermal zone device registered.\n"); @@ -461,9 +464,11 @@ static int db8500_thermal_probe(struct platform_device *pdev) platform_set_drvdata(pdev, pzone); pzone->mode = THERMAL_DEVICE_ENABLED; + +out_unlock: mutex_unlock(&pzone->th_lock); - return 0; + return ret; } static int db8500_thermal_remove(struct platform_device *pdev)