diff options
Diffstat (limited to 'drivers/acpi/executer/exoparg3.c')
-rw-r--r-- | drivers/acpi/executer/exoparg3.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/acpi/executer/exoparg3.c b/drivers/acpi/executer/exoparg3.c index 6a3a883cb8a3..e2d945dfd509 100644 --- a/drivers/acpi/executer/exoparg3.c +++ b/drivers/acpi/executer/exoparg3.c | |||
@@ -88,20 +88,19 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state) | |||
88 | struct acpi_signal_fatal_info *fatal; | 88 | struct acpi_signal_fatal_info *fatal; |
89 | acpi_status status = AE_OK; | 89 | acpi_status status = AE_OK; |
90 | 90 | ||
91 | ACPI_FUNCTION_TRACE_STR("ex_opcode_3A_0T_0R", | 91 | ACPI_FUNCTION_TRACE_STR(ex_opcode_3A_0T_0R, |
92 | acpi_ps_get_opcode_name(walk_state->opcode)); | 92 | acpi_ps_get_opcode_name(walk_state->opcode)); |
93 | 93 | ||
94 | switch (walk_state->opcode) { | 94 | switch (walk_state->opcode) { |
95 | case AML_FATAL_OP: /* Fatal (fatal_type fatal_code fatal_arg) */ | 95 | case AML_FATAL_OP: /* Fatal (fatal_type fatal_code fatal_arg) */ |
96 | 96 | ||
97 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 97 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
98 | "fatal_op: Type %X Code %X Arg %X <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n", | 98 | "FatalOp: Type %X Code %X Arg %X <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n", |
99 | (u32) operand[0]->integer.value, | 99 | (u32) operand[0]->integer.value, |
100 | (u32) operand[1]->integer.value, | 100 | (u32) operand[1]->integer.value, |
101 | (u32) operand[2]->integer.value)); | 101 | (u32) operand[2]->integer.value)); |
102 | 102 | ||
103 | fatal = | 103 | fatal = ACPI_ALLOCATE(sizeof(struct acpi_signal_fatal_info)); |
104 | ACPI_MEM_ALLOCATE(sizeof(struct acpi_signal_fatal_info)); | ||
105 | if (fatal) { | 104 | if (fatal) { |
106 | fatal->type = (u32) operand[0]->integer.value; | 105 | fatal->type = (u32) operand[0]->integer.value; |
107 | fatal->code = (u32) operand[1]->integer.value; | 106 | fatal->code = (u32) operand[1]->integer.value; |
@@ -114,7 +113,7 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state) | |||
114 | 113 | ||
115 | /* Might return while OS is shutting down, just continue */ | 114 | /* Might return while OS is shutting down, just continue */ |
116 | 115 | ||
117 | ACPI_MEM_FREE(fatal); | 116 | ACPI_FREE(fatal); |
118 | break; | 117 | break; |
119 | 118 | ||
120 | default: | 119 | default: |
@@ -151,7 +150,7 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state) | |||
151 | acpi_integer index; | 150 | acpi_integer index; |
152 | acpi_size length; | 151 | acpi_size length; |
153 | 152 | ||
154 | ACPI_FUNCTION_TRACE_STR("ex_opcode_3A_1T_1R", | 153 | ACPI_FUNCTION_TRACE_STR(ex_opcode_3A_1T_1R, |
155 | acpi_ps_get_opcode_name(walk_state->opcode)); | 154 | acpi_ps_get_opcode_name(walk_state->opcode)); |
156 | 155 | ||
157 | switch (walk_state->opcode) { | 156 | switch (walk_state->opcode) { |
@@ -196,7 +195,7 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state) | |||
196 | 195 | ||
197 | /* Always allocate a new buffer for the String */ | 196 | /* Always allocate a new buffer for the String */ |
198 | 197 | ||
199 | buffer = ACPI_MEM_CALLOCATE((acpi_size) length + 1); | 198 | buffer = ACPI_ALLOCATE_ZEROED((acpi_size) length + 1); |
200 | if (!buffer) { | 199 | if (!buffer) { |
201 | status = AE_NO_MEMORY; | 200 | status = AE_NO_MEMORY; |
202 | goto cleanup; | 201 | goto cleanup; |
@@ -208,9 +207,10 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state) | |||
208 | /* If the requested length is zero, don't allocate a buffer */ | 207 | /* If the requested length is zero, don't allocate a buffer */ |
209 | 208 | ||
210 | if (length > 0) { | 209 | if (length > 0) { |
210 | |||
211 | /* Allocate a new buffer for the Buffer */ | 211 | /* Allocate a new buffer for the Buffer */ |
212 | 212 | ||
213 | buffer = ACPI_MEM_CALLOCATE(length); | 213 | buffer = ACPI_ALLOCATE_ZEROED(length); |
214 | if (!buffer) { | 214 | if (!buffer) { |
215 | status = AE_NO_MEMORY; | 215 | status = AE_NO_MEMORY; |
216 | goto cleanup; | 216 | goto cleanup; |
@@ -225,6 +225,7 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state) | |||
225 | } | 225 | } |
226 | 226 | ||
227 | if (buffer) { | 227 | if (buffer) { |
228 | |||
228 | /* We have a buffer, copy the portion requested */ | 229 | /* We have a buffer, copy the portion requested */ |
229 | 230 | ||
230 | ACPI_MEMCPY(buffer, operand[0]->string.pointer + index, | 231 | ACPI_MEMCPY(buffer, operand[0]->string.pointer + index, |