public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ACPICA: cleanup method properly on error
@ 2016-07-22 15:35 Vegard Nossum
  2016-07-26 14:39 ` Moore, Robert
  2016-07-29  4:47 ` Zheng, Lv
  0 siblings, 2 replies; 6+ messages in thread
From: Vegard Nossum @ 2016-07-22 15:35 UTC (permalink / raw)
  To: Robert Moore, Lv Zheng, Rafael J. Wysocki
  Cc: linux-acpi, devel, linux-kernel, Vegard Nossum, stable

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.

You can observe this when reading e.g.

    /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0F:01/status

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);
 
 	return_ACPI_STATUS(status);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-07-29  7:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-22 15:35 [PATCH] ACPICA: cleanup method properly on error Vegard Nossum
2016-07-26 14:39 ` Moore, Robert
2016-07-26 20:28   ` Moore, Robert
2016-07-27  5:38     ` Vegard Nossum
2016-07-29  4:47 ` Zheng, Lv
2016-07-29  7:13   ` Vegard Nossum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox