mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wen Congyang <wency@cn.fujitsu.com>
To: Wei Yongjun <weiyj.lk@gmail.com>
Cc: lenb@kernel.org, rjw@sisk.pl, yongjun_wei@trendmicro.com.cn,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [PATCH -next] ACPI: fix missing unlock on error in acpi_memory_remove_memory()
Date: Thu, 08 Nov 2012 09:31:43 +0800	[thread overview]
Message-ID: <509B0B7F.3030308@cn.fujitsu.com> (raw)
In-Reply-To: <CAPgLHd_=OTwu-3tVXT0o8+x=N_9dZOkQ4A7HFr0SNdUiyAy_yw@mail.gmail.com>

Hi, wei

At 11/07/2012 08:38 PM, Wei Yongjun Wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Add the missing mutex_unlock() before return from function
> acpi_memory_remove_memory() in the error handling case.
> 
> Introduce by commit 85fcb3758c10e063a2a30dfad75017097999deed
> 'ACPI / memory-hotplug: introduce a mutex lock to protect the list in acpi_memory_device'
> 
> dpatch engine is used to auto generate this patch.
> (https://github.com/weiyj/dpatch)
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Thanks for your patch.

Dan Carpenter has told me this problem. I fix it, but don't
resend it because it is in test now.

Thanks
Wen Congyang

> ---
>  drivers/acpi/acpi_memhotplug.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
> index 92c973a..e573e87 100644
> --- a/drivers/acpi/acpi_memhotplug.c
> +++ b/drivers/acpi/acpi_memhotplug.c
> @@ -325,8 +325,10 @@ static int acpi_memory_remove_memory(struct acpi_memory_device *mem_device)
>  	list_for_each_entry_safe(info, n, &mem_device->res_list, list) {
>  		if (info->enabled) {
>  			result = remove_memory(info->start_addr, info->length);
> -			if (result)
> +			if (result) {
> +				mutex_unlock(&mem_device->list_lock);
>  				return result;
> +			}
>  		}
>  
>  		list_del(&info->list);
> 
> 
> 


  reply	other threads:[~2012-11-08  1:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-07 12:38 Wei Yongjun
2012-11-08  1:31 ` Wen Congyang [this message]
2012-11-08  4:31   ` Wei Yongjun

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=509B0B7F.3030308@cn.fujitsu.com \
    --to=wency@cn.fujitsu.com \
    --cc=dan.carpenter@oracle.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=weiyj.lk@gmail.com \
    --cc=yongjun_wei@trendmicro.com.cn \
    /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®