ACPI: ACPICA 20060331
[linux-drm-fsl-dcu.git] / drivers / acpi / utilities / utstate.c
index 637c5f964879a186a60afb8331cdee9382a79f37..aec5034cd97847d8a16f6c12fff3d78b2e956166 100644 (file)
@@ -321,8 +321,8 @@ union acpi_generic_state *acpi_ut_create_control_state(void)
  *
  * RETURN:      None
  *
- * DESCRIPTION: Put a state object back into the global state cache.  The object
- *              is not actually freed at this time.
+ * DESCRIPTION: Release a state object to the state cache. NULL state objects
+ *              are ignored.
  *
  ******************************************************************************/
 
@@ -330,6 +330,10 @@ void acpi_ut_delete_generic_state(union acpi_generic_state *state)
 {
        ACPI_FUNCTION_TRACE("ut_delete_generic_state");
 
-       (void)acpi_os_release_object(acpi_gbl_state_cache, state);
+       /* Ignore null state */
+
+       if (state) {
+               (void)acpi_os_release_object(acpi_gbl_state_cache, state);
+       }
        return_VOID;
 }