Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1452260

RE: [PATCH] ACPICA: cleanup method properly on error

From "Zheng, Lv" <lv.zheng@intel.com>
Newsgroups linux.kernel
Subject RE: [PATCH] ACPICA: cleanup method properly on error
Date 2016-07-29 06:50 +0200
Message-ID <s07Ud-8gN-5@gated-at.bofh.it> (permalink)
References <rXKIq-7Bs-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi, Vegard

> From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi-
> owner@vger.kernel.org] On Behalf Of Vegard Nossum
> Subject: [PATCH] ACPICA: cleanup method properly on error
> 
> If the call to acpi_ds_init_aml_walk() fails, then we have to undo the
> walk state push done by acpi_ds_create_walk_state(). Otherwise, the new
> walk state (which has just been freed) will remain on the thread's
> walk_state_list and be dereferenced in acpi_ps_parse_aml() when we try
> to get the new state.
[Lv Zheng] 
I haven't looked into the detail.
Let me first ask simple questions and present simple concerns in order to move this discussion on.

> 
> You can observe this when reading e.g.
> 
>     /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0F:01/status
[Lv Zheng] 
Do you mean you have real issues related to this?
If so, could provide the .config and dmesg for us?

> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
> ---
>  drivers/acpi/acpica/dsmethod.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/acpi/acpica/dsmethod.c
> b/drivers/acpi/acpica/dsmethod.c
> index 47c7b52..44b50a6 100644
> --- a/drivers/acpi/acpica/dsmethod.c
> +++ b/drivers/acpi/acpica/dsmethod.c
> @@ -596,6 +596,8 @@ cleanup:
>  	/* On error, we must terminate the method properly */
> 
>  	acpi_ds_terminate_control_method(obj_desc, next_walk_state);
> +	if (thread)
> +		acpi_ds_pop_walk_state(thread);
>  	acpi_ds_delete_walk_state(next_walk_state);
[Lv Zheng] 
It seems, if acpi_ds_create_walk_state() fails, acpi_ds_delete_walk_state() will be invoked.
So they are paired. Fixing this in acpi_ds_delete_walk_state() could help to fix all of them.
Given the fix is useful, why don't you do this in acpi_ds_delete_walk_state()?

Thanks and best regards
-Lv

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

RE: [PATCH] ACPICA: cleanup method properly on error "Zheng, Lv" <lv.zheng@intel.com> - 2016-07-29 06:50 +0200
  Re: [PATCH] ACPICA: cleanup method properly on error Vegard Nossum <vegard.nossum@oracle.com> - 2016-07-29 09:20 +0200

csiph-web