diff options
Diffstat (limited to 'drivers/acpi/tables/tbinstal.c')
-rw-r--r-- | drivers/acpi/tables/tbinstal.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/acpi/tables/tbinstal.c b/drivers/acpi/tables/tbinstal.c index 7ca2df75bb11..1668a232fb67 100644 --- a/drivers/acpi/tables/tbinstal.c +++ b/drivers/acpi/tables/tbinstal.c | |||
@@ -256,7 +256,7 @@ acpi_tb_init_table_descriptor(acpi_table_type table_type, | |||
256 | 256 | ||
257 | status = acpi_ut_allocate_owner_id(&table_desc->owner_id); | 257 | status = acpi_ut_allocate_owner_id(&table_desc->owner_id); |
258 | if (ACPI_FAILURE(status)) { | 258 | if (ACPI_FAILURE(status)) { |
259 | return_ACPI_STATUS(status); | 259 | goto error_exit1; |
260 | } | 260 | } |
261 | 261 | ||
262 | /* Install the table into the global data structure */ | 262 | /* Install the table into the global data structure */ |
@@ -274,8 +274,8 @@ acpi_tb_init_table_descriptor(acpi_table_type table_type, | |||
274 | * at this location, so return an error. | 274 | * at this location, so return an error. |
275 | */ | 275 | */ |
276 | if (list_head->next) { | 276 | if (list_head->next) { |
277 | ACPI_FREE(table_desc); | 277 | status = AE_ALREADY_EXISTS; |
278 | return_ACPI_STATUS(AE_ALREADY_EXISTS); | 278 | goto error_exit2; |
279 | } | 279 | } |
280 | 280 | ||
281 | table_desc->next = list_head->next; | 281 | table_desc->next = list_head->next; |
@@ -335,6 +335,17 @@ acpi_tb_init_table_descriptor(acpi_table_type table_type, | |||
335 | table_info->owner_id = table_desc->owner_id; | 335 | table_info->owner_id = table_desc->owner_id; |
336 | table_info->installed_desc = table_desc; | 336 | table_info->installed_desc = table_desc; |
337 | return_ACPI_STATUS(AE_OK); | 337 | return_ACPI_STATUS(AE_OK); |
338 | |||
339 | /* Error exit with cleanup */ | ||
340 | |||
341 | error_exit2: | ||
342 | |||
343 | acpi_ut_release_owner_id(&table_desc->owner_id); | ||
344 | |||
345 | error_exit1: | ||
346 | |||
347 | ACPI_FREE(table_desc); | ||
348 | return_ACPI_STATUS(status); | ||
338 | } | 349 | } |
339 | 350 | ||
340 | /******************************************************************************* | 351 | /******************************************************************************* |
@@ -525,6 +536,10 @@ struct acpi_table_desc *acpi_tb_uninstall_table(struct acpi_table_desc | |||
525 | 536 | ||
526 | acpi_tb_delete_single_table(table_desc); | 537 | acpi_tb_delete_single_table(table_desc); |
527 | 538 | ||
539 | /* Free the owner ID associated with this table */ | ||
540 | |||
541 | acpi_ut_release_owner_id(&table_desc->owner_id); | ||
542 | |||
528 | /* Free the table descriptor */ | 543 | /* Free the table descriptor */ |
529 | 544 | ||
530 | next_desc = table_desc->next; | 545 | next_desc = table_desc->next; |