]> err.no Git - linux-2.6/blobdiff - drivers/acpi/events/evxfregn.c
Merge branch 'for-2.6.26' of master.kernel.org:/pub/scm/linux/kernel/git/jwboyer...
[linux-2.6] / drivers / acpi / events / evxfregn.c
index e8b86a0baad01f710121fe977d1d920d0606dcf9..e8750807e57d004151fab56cc56198f73acb29b6 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2006, R. Byron Moore
+ * Copyright (C) 2000 - 2008, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -155,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;
        }
@@ -178,6 +182,13 @@ acpi_remove_address_space_handler(acpi_handle device,
 
                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,