* [PATCH -next] ACPI: fix missing unlock on error in acpi_memory_remove_memory()
@ 2012-11-07 12:38 Wei Yongjun
2012-11-08 1:31 ` Wen Congyang
0 siblings, 1 reply; 3+ messages in thread
From: Wei Yongjun @ 2012-11-07 12:38 UTC (permalink / raw)
To: lenb, rjw, wency; +Cc: yongjun_wei, linux-acpi, linux-kernel
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>
---
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);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] ACPI: fix missing unlock on error in acpi_memory_remove_memory()
2012-11-07 12:38 [PATCH -next] ACPI: fix missing unlock on error in acpi_memory_remove_memory() Wei Yongjun
@ 2012-11-08 1:31 ` Wen Congyang
2012-11-08 4:31 ` Wei Yongjun
0 siblings, 1 reply; 3+ messages in thread
From: Wen Congyang @ 2012-11-08 1:31 UTC (permalink / raw)
To: Wei Yongjun
Cc: lenb, rjw, yongjun_wei, linux-acpi, linux-kernel, Dan Carpenter
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);
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] ACPI: fix missing unlock on error in acpi_memory_remove_memory()
2012-11-08 1:31 ` Wen Congyang
@ 2012-11-08 4:31 ` Wei Yongjun
0 siblings, 0 replies; 3+ messages in thread
From: Wei Yongjun @ 2012-11-08 4:31 UTC (permalink / raw)
To: wency; +Cc: lenb, rjw, yongjun_wei, linux-acpi, linux-kernel, dan.carpenter
Hi Wen,
On 11/08/2012 09:31 AM, Wen Congyang wrote:
> 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.
I saw your patchset has already applied to linux-pm.git tree:
http://git.kernel.org/?p=linux/kernel/git/rafael/linux-pm.git;a=shortlog;h=refs/heads/linux-next
So I think what need is to send a new patch to fix it, not
resend the full patchset.
Regards,
Yongjun Wei
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-11-08 4:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-07 12:38 [PATCH -next] ACPI: fix missing unlock on error in acpi_memory_remove_memory() Wei Yongjun
2012-11-08 1:31 ` Wen Congyang
2012-11-08 4:31 ` Wei Yongjun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).