aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utilities/utstate.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/utilities/utstate.c')
-rw-r--r--drivers/acpi/utilities/utstate.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/acpi/utilities/utstate.c b/drivers/acpi/utilities/utstate.c
index 637c5f964879a..aec5034cd9784 100644
--- a/drivers/acpi/utilities/utstate.c
+++ b/drivers/acpi/utilities/utstate.c
@@ -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;
}