X-Git-Url: http://git.onelab.eu/?p=linux-2.6.git;a=blobdiff_plain;f=drivers%2Facpi%2Fevents%2Fevxfregn.c;fp=drivers%2Facpi%2Fevents%2Fevxfregn.c;h=83b12a9afa325827fe6148588bc5034efa3ce860;hp=abf5caca9ae5a541596e6ee612665cc4566b9a82;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hpb=76828883507a47dae78837ab5dec5a5b4513c667 diff --git a/drivers/acpi/events/evxfregn.c b/drivers/acpi/events/evxfregn.c index abf5caca9..83b12a9af 100644 --- a/drivers/acpi/events/evxfregn.c +++ b/drivers/acpi/events/evxfregn.c @@ -42,8 +42,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ -#include - #include #include #include @@ -75,7 +73,7 @@ acpi_install_address_space_handler(acpi_handle device, struct acpi_namespace_node *node; acpi_status status; - ACPI_FUNCTION_TRACE("acpi_install_address_space_handler"); + ACPI_FUNCTION_TRACE(acpi_install_address_space_handler); /* Parameter validation */ @@ -114,7 +112,7 @@ acpi_install_address_space_handler(acpi_handle device, return_ACPI_STATUS(status); } -EXPORT_SYMBOL(acpi_install_address_space_handler); +ACPI_EXPORT_SYMBOL(acpi_install_address_space_handler) /******************************************************************************* * @@ -129,7 +127,6 @@ EXPORT_SYMBOL(acpi_install_address_space_handler); * DESCRIPTION: Remove a previously installed handler. * ******************************************************************************/ - acpi_status acpi_remove_address_space_handler(acpi_handle device, acpi_adr_space_type space_id, @@ -142,7 +139,7 @@ acpi_remove_address_space_handler(acpi_handle device, struct acpi_namespace_node *node; acpi_status status; - ACPI_FUNCTION_TRACE("acpi_remove_address_space_handler"); + ACPI_FUNCTION_TRACE(acpi_remove_address_space_handler); /* Parameter validation */ @@ -158,7 +155,11 @@ acpi_remove_address_space_handler(acpi_handle device, /* Convert and validate the device handle */ node = acpi_ns_map_handle_to_node(device); - if (!node) { + if (!node || + ((node->type != ACPI_TYPE_DEVICE) && + (node->type != ACPI_TYPE_PROCESSOR) && + (node->type != ACPI_TYPE_THERMAL) && + (node != acpi_gbl_root_node))) { status = AE_BAD_PARAMETER; goto unlock_and_exit; } @@ -176,9 +177,18 @@ acpi_remove_address_space_handler(acpi_handle device, handler_obj = obj_desc->device.handler; last_obj_ptr = &obj_desc->device.handler; while (handler_obj) { + /* We have a handler, see if user requested this one */ if (handler_obj->address_space.space_id == space_id) { + + /* Handler must be the same as the installed handler */ + + if (handler_obj->address_space.handler != handler) { + status = AE_BAD_PARAMETER; + goto unlock_and_exit; + } + /* Matched space_id, first dereference this in the Regions */ ACPI_DEBUG_PRINT((ACPI_DB_OPREGION, @@ -229,7 +239,7 @@ acpi_remove_address_space_handler(acpi_handle device, /* The handler does not exist */ ACPI_DEBUG_PRINT((ACPI_DB_OPREGION, - "Unable to remove address handler %p for %s(%X), dev_node %p, obj %p\n", + "Unable to remove address handler %p for %s(%X), DevNode %p, obj %p\n", handler, acpi_ut_get_region_name(space_id), space_id, node, obj_desc)); @@ -240,4 +250,4 @@ acpi_remove_address_space_handler(acpi_handle device, return_ACPI_STATUS(status); } -EXPORT_SYMBOL(acpi_remove_address_space_handler); +ACPI_EXPORT_SYMBOL(acpi_remove_address_space_handler)