aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2015-05-20 22:31:06 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-05-21 21:22:20 -0400
commitc8dec7459d9fcb880e5c42929d01c308bea9f823 (patch)
treed11cffbbd666362c5471cce92fb415cd95fe155d
parent9ab8cf1b699758d502411ad9d131ff521ca01cd6 (diff)
ACPICA: Dispatcher: Fix a resource leak issue in acpi_ds_auto_serialize_method().
ACPICA commit 29d03840cbab435e8ea82e9339ff9d84535c647d This patch fixes a resource leak issue in acpi_ds_auto_serialize_method(). It is reported by the "Coverity" tool as unsecure code. Lv Zheng. Link: https://github.com/acpica/acpica/commit/29d03840 Link: https://jira01.devtools.intel.com/browse/LCK-2142 Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/acpica/dsmethod.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c
index d72565a3c646..85bb951430d9 100644
--- a/drivers/acpi/acpica/dsmethod.c
+++ b/drivers/acpi/acpica/dsmethod.c
@@ -116,6 +116,7 @@ acpi_ds_auto_serialize_method(struct acpi_namespace_node *node,
116 walk_state = 116 walk_state =
117 acpi_ds_create_walk_state(node->owner_id, NULL, NULL, NULL); 117 acpi_ds_create_walk_state(node->owner_id, NULL, NULL, NULL);
118 if (!walk_state) { 118 if (!walk_state) {
119 acpi_ps_free_op(op);
119 return_ACPI_STATUS(AE_NO_MEMORY); 120 return_ACPI_STATUS(AE_NO_MEMORY);
120 } 121 }
121 122
@@ -125,6 +126,7 @@ acpi_ds_auto_serialize_method(struct acpi_namespace_node *node,
125 obj_desc->method.aml_length, NULL, 0); 126 obj_desc->method.aml_length, NULL, 0);
126 if (ACPI_FAILURE(status)) { 127 if (ACPI_FAILURE(status)) {
127 acpi_ds_delete_walk_state(walk_state); 128 acpi_ds_delete_walk_state(walk_state);
129 acpi_ps_free_op(op);
128 return_ACPI_STATUS(status); 130 return_ACPI_STATUS(status);
129 } 131 }
130 132
@@ -133,9 +135,6 @@ acpi_ds_auto_serialize_method(struct acpi_namespace_node *node,
133 /* Parse the method, scan for creation of named objects */ 135 /* Parse the method, scan for creation of named objects */
134 136
135 status = acpi_ps_parse_aml(walk_state); 137 status = acpi_ps_parse_aml(walk_state);
136 if (ACPI_FAILURE(status)) {
137 return_ACPI_STATUS(status);
138 }
139 138
140 acpi_ps_delete_parse_tree(op); 139 acpi_ps_delete_parse_tree(op);
141 return_ACPI_STATUS(status); 140 return_ACPI_STATUS(status);