aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/namespace/nsparse.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/namespace/nsparse.c')
-rw-r--r--drivers/acpi/namespace/nsparse.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/acpi/namespace/nsparse.c b/drivers/acpi/namespace/nsparse.c
index 86bd6e5920c7..f260b6941c13 100644
--- a/drivers/acpi/namespace/nsparse.c
+++ b/drivers/acpi/namespace/nsparse.c
@@ -112,21 +112,25 @@ acpi_ns_one_complete_parse(acpi_native_uint pass_number,
112 aml_start = (u8 *) table + sizeof(struct acpi_table_header); 112 aml_start = (u8 *) table + sizeof(struct acpi_table_header);
113 aml_length = table->length - sizeof(struct acpi_table_header); 113 aml_length = table->length - sizeof(struct acpi_table_header);
114 status = acpi_ds_init_aml_walk(walk_state, parse_root, NULL, 114 status = acpi_ds_init_aml_walk(walk_state, parse_root, NULL,
115 aml_start, aml_length, NULL, 115 aml_start, (u32) aml_length,
116 (u8) pass_number); 116 NULL, (u8) pass_number);
117 } 117 }
118 118
119 if (ACPI_FAILURE(status)) { 119 if (ACPI_FAILURE(status)) {
120 acpi_ds_delete_walk_state(walk_state); 120 acpi_ds_delete_walk_state(walk_state);
121 acpi_ps_delete_parse_tree(parse_root); 121 goto cleanup;
122 return_ACPI_STATUS(status);
123 } 122 }
124 123
125 /* start_node is the default location to load the table */ 124 /* start_node is the default location to load the table */
126 125
127 if (start_node && start_node != acpi_gbl_root_node) { 126 if (start_node && start_node != acpi_gbl_root_node) {
128 acpi_ds_scope_stack_push(start_node, ACPI_TYPE_METHOD, 127 status =
129 walk_state); 128 acpi_ds_scope_stack_push(start_node, ACPI_TYPE_METHOD,
129 walk_state);
130 if (ACPI_FAILURE(status)) {
131 acpi_ds_delete_walk_state(walk_state);
132 goto cleanup;
133 }
130 } 134 }
131 135
132 /* Parse the AML */ 136 /* Parse the AML */
@@ -135,6 +139,7 @@ acpi_ns_one_complete_parse(acpi_native_uint pass_number,
135 (unsigned)pass_number)); 139 (unsigned)pass_number));
136 status = acpi_ps_parse_aml(walk_state); 140 status = acpi_ps_parse_aml(walk_state);
137 141
142 cleanup:
138 acpi_ps_delete_parse_tree(parse_root); 143 acpi_ps_delete_parse_tree(parse_root);
139 return_ACPI_STATUS(status); 144 return_ACPI_STATUS(status);
140} 145}