aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/executer
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/executer')
-rw-r--r--drivers/acpi/executer/exconfig.c19
-rw-r--r--drivers/acpi/executer/exdump.c2
-rw-r--r--drivers/acpi/executer/exoparg1.c2
3 files changed, 16 insertions, 7 deletions
diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c
index 76c6ebd0231f..d11e9ec827f1 100644
--- a/drivers/acpi/executer/exconfig.c
+++ b/drivers/acpi/executer/exconfig.c
@@ -99,6 +99,11 @@ acpi_ex_add_table (
99 return_ACPI_STATUS (AE_NO_MEMORY); 99 return_ACPI_STATUS (AE_NO_MEMORY);
100 } 100 }
101 101
102 /* Init the table handle */
103
104 obj_desc->reference.opcode = AML_LOAD_OP;
105 *ddb_handle = obj_desc;
106
102 /* Install the new table into the local data structures */ 107 /* Install the new table into the local data structures */
103 108
104 ACPI_MEMSET (&table_info, 0, sizeof (struct acpi_table_desc)); 109 ACPI_MEMSET (&table_info, 0, sizeof (struct acpi_table_desc));
@@ -109,7 +114,14 @@ acpi_ex_add_table (
109 table_info.allocation = ACPI_MEM_ALLOCATED; 114 table_info.allocation = ACPI_MEM_ALLOCATED;
110 115
111 status = acpi_tb_install_table (&table_info); 116 status = acpi_tb_install_table (&table_info);
117 obj_desc->reference.object = table_info.installed_desc;
118
112 if (ACPI_FAILURE (status)) { 119 if (ACPI_FAILURE (status)) {
120 if (status == AE_ALREADY_EXISTS) {
121 /* Table already exists, just return the handle */
122
123 return_ACPI_STATUS (AE_OK);
124 }
113 goto cleanup; 125 goto cleanup;
114 } 126 }
115 127
@@ -123,16 +135,12 @@ acpi_ex_add_table (
123 goto cleanup; 135 goto cleanup;
124 } 136 }
125 137
126 /* Init the table handle */
127
128 obj_desc->reference.opcode = AML_LOAD_OP;
129 obj_desc->reference.object = table_info.installed_desc;
130 *ddb_handle = obj_desc;
131 return_ACPI_STATUS (AE_OK); 138 return_ACPI_STATUS (AE_OK);
132 139
133 140
134cleanup: 141cleanup:
135 acpi_ut_remove_reference (obj_desc); 142 acpi_ut_remove_reference (obj_desc);
143 *ddb_handle = NULL;
136 return_ACPI_STATUS (status); 144 return_ACPI_STATUS (status);
137} 145}
138 146
@@ -488,6 +496,7 @@ acpi_ex_unload_table (
488 * (Offset contains the table_id) 496 * (Offset contains the table_id)
489 */ 497 */
490 acpi_ns_delete_namespace_by_owner (table_info->owner_id); 498 acpi_ns_delete_namespace_by_owner (table_info->owner_id);
499 acpi_ut_release_owner_id (&table_info->owner_id);
491 500
492 /* Delete the table itself */ 501 /* Delete the table itself */
493 502
diff --git a/drivers/acpi/executer/exdump.c b/drivers/acpi/executer/exdump.c
index fd13cc3db018..4f98dceed39a 100644
--- a/drivers/acpi/executer/exdump.c
+++ b/drivers/acpi/executer/exdump.c
@@ -598,7 +598,7 @@ acpi_ex_dump_reference (
598 acpi_os_printf ("Could not convert name to pathname\n"); 598 acpi_os_printf ("Could not convert name to pathname\n");
599 } 599 }
600 else { 600 else {
601 acpi_os_printf ("%s\n", ret_buf.pointer); 601 acpi_os_printf ("%s\n", (char *) ret_buf.pointer);
602 ACPI_MEM_FREE (ret_buf.pointer); 602 ACPI_MEM_FREE (ret_buf.pointer);
603 } 603 }
604 } 604 }
diff --git a/drivers/acpi/executer/exoparg1.c b/drivers/acpi/executer/exoparg1.c
index c1ba8b48228e..48c30f800083 100644
--- a/drivers/acpi/executer/exoparg1.c
+++ b/drivers/acpi/executer/exoparg1.c
@@ -955,7 +955,7 @@ acpi_ex_opcode_1A_0T_1R (
955 */ 955 */
956 return_desc = *(operand[0]->reference.where); 956 return_desc = *(operand[0]->reference.where);
957 if (return_desc) { 957 if (return_desc) {
958 acpi_ut_add_reference (return_desc); 958 acpi_ut_add_reference (return_desc);
959 } 959 }
960 960
961 break; 961 break;