mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Lan Tianyu <tianyu.lan@intel.com>
Cc: lenb@kernel.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ACPI/Power: Release resource_lock after acpi_power_get_state() return error
Date: Tue, 15 Oct 2013 23:06:58 +0200	[thread overview]
Message-ID: <2169851.4V0lKD9xHQ@vostro.rjw.lan> (raw)
In-Reply-To: <1381837691-3657-1-git-send-email-tianyu.lan@intel.com>

On Tuesday, October 15, 2013 07:48:11 PM Lan Tianyu wrote:
> resource_lock should be released when acpi_power_get_state() fails and before
> passing to next power resource on the acpi power resource list.
> 
> Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>

Yup, good catch!

I'll queue this up as a fix for 3.12.

Thanks!

> ---
>  drivers/acpi/power.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
> index 0dbe5cd..0c1c3ec 100644
> --- a/drivers/acpi/power.c
> +++ b/drivers/acpi/power.c
> @@ -936,8 +936,10 @@ void acpi_resume_power_resources(void)
>  		mutex_lock(&resource->resource_lock);
>  
>  		result = acpi_power_get_state(resource->device.handle, &state);
> -		if (result)
> +		if (result) {
> +			mutex_unlock(&resource->resource_lock);
>  			continue;
> +		}
>  
>  		if (state == ACPI_POWER_RESOURCE_STATE_OFF
>  		    && resource->ref_count) {
> 
-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

      reply	other threads:[~2013-10-15 20:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-15 11:48 Lan Tianyu
2013-10-15 21:06 ` Rafael J. Wysocki [this message]

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=2169851.4V0lKD9xHQ@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tianyu.lan@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®