From: Zhang Rui <rui.zhang@intel.com>
To: Axel Lin <axel.lin@ingics.com>
Cc: Hongbo Zhang <hongbo.zhang@stericsson.com>,
Viresh Kumar <viresh.kumar@linaro.org>,
Francesco Lavra <francescolavra.fl@gmail.com>,
linux-pm@vger.kernel.org
Subject: Re: [PATCH 2/2] thermal: db8500: Fix missing mutex_unlock() in probe error paths
Date: Mon, 25 Mar 2013 16:09:39 +0800 [thread overview]
Message-ID: <1364198979.2465.42.camel@rzhang1-mobl4> (raw)
In-Reply-To: <1363103009.3160.3.camel@phoenix>
On Tue, 2013-03-12 at 23:43 +0800, Axel Lin wrote:
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
applied to thermal -next.
thanks,
rui
> ---
> 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)
next prev parent reply other threads:[~2013-03-25 8:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-12 15:42 [PATCH 1/2] thermal: db8500: Fix checking return value of thermal_zone_device_register Axel Lin
2013-03-12 15:43 ` [PATCH 2/2] thermal: db8500: Fix missing mutex_unlock() in probe error paths Axel Lin
2013-03-13 8:13 ` Hongbo Zhang
2013-03-13 8:17 ` Axel Lin
2013-03-25 8:09 ` Zhang Rui [this message]
2013-03-25 8:09 ` [PATCH 1/2] thermal: db8500: Fix checking return value of thermal_zone_device_register Zhang Rui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1364198979.2465.42.camel@rzhang1-mobl4 \
--to=rui.zhang@intel.com \
--cc=axel.lin@ingics.com \
--cc=francescolavra.fl@gmail.com \
--cc=hongbo.zhang@stericsson.com \
--cc=linux-pm@vger.kernel.org \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.