diff --git a/sys/dev/nvdimm/nvdimm_acpi.c b/sys/dev/nvdimm/nvdimm_acpi.c --- a/sys/dev/nvdimm/nvdimm_acpi.c +++ b/sys/dev/nvdimm/nvdimm_acpi.c @@ -67,14 +67,18 @@ ACPI_DEVICE_INFO *device_info; ACPI_STATUS status; + device_info = NULL; status = AcpiGetObjectInfo(handle, &device_info); if (ACPI_FAILURE(status)) return_ACPI_STATUS(AE_ERROR); if (device_info->Address == (uintptr_t)context) { *(ACPI_HANDLE *)return_value = handle; - return_ACPI_STATUS(AE_CTRL_TERMINATE); - } - return_ACPI_STATUS(AE_OK); + status = AE_CTRL_TERMINATE; + } else + status = AE_OK; + + AcpiOsFree(device_info); + return_ACPI_STATUS(status); } static ACPI_HANDLE