You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
ACPICA: Add support to delete all objects attached to the root namespace node.
This fix deletes any and all objects that have been attached to the root node (via acpi_attach_data). Reported by Tomasz Nowicki. ACPICA BZ 1026. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
committed by
Rafael J. Wysocki
parent
794ba09bf3
commit
3f69fe1531
@@ -134,6 +134,12 @@ void acpi_ns_delete_node(struct acpi_namespace_node *node)
|
|||||||
obj_desc = next_desc;
|
obj_desc = next_desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Special case for the statically allocated root node */
|
||||||
|
|
||||||
|
if (node == acpi_gbl_root_node) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Now we can delete the node */
|
/* Now we can delete the node */
|
||||||
|
|
||||||
(void)acpi_os_release_object(acpi_gbl_namespace_cache, node);
|
(void)acpi_os_release_object(acpi_gbl_namespace_cache, node);
|
||||||
|
|||||||
@@ -593,24 +593,26 @@ struct acpi_namespace_node *acpi_ns_validate_handle(acpi_handle handle)
|
|||||||
|
|
||||||
void acpi_ns_terminate(void)
|
void acpi_ns_terminate(void)
|
||||||
{
|
{
|
||||||
union acpi_operand_object *obj_desc;
|
acpi_status status;
|
||||||
|
|
||||||
ACPI_FUNCTION_TRACE(ns_terminate);
|
ACPI_FUNCTION_TRACE(ns_terminate);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 1) Free the entire namespace -- all nodes and objects
|
* Free the entire namespace -- all nodes and all objects
|
||||||
*
|
* attached to the nodes
|
||||||
* Delete all object descriptors attached to namepsace nodes
|
|
||||||
*/
|
*/
|
||||||
acpi_ns_delete_namespace_subtree(acpi_gbl_root_node);
|
acpi_ns_delete_namespace_subtree(acpi_gbl_root_node);
|
||||||
|
|
||||||
/* Detach any objects attached to the root */
|
/* Delete any objects attached to the root node */
|
||||||
|
|
||||||
obj_desc = acpi_ns_get_attached_object(acpi_gbl_root_node);
|
status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
|
||||||
if (obj_desc) {
|
if (ACPI_FAILURE(status)) {
|
||||||
acpi_ns_detach_object(acpi_gbl_root_node);
|
return_VOID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
acpi_ns_delete_node(acpi_gbl_root_node);
|
||||||
|
(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
|
||||||
|
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Namespace freed\n"));
|
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Namespace freed\n"));
|
||||||
return_VOID;
|
return_VOID;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user