diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-01-05 21:57:25 (GMT) |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-01-05 21:57:25 (GMT) |
commit | c8d150761ca6d1266cbcdc1a64529759b5b6068e (patch) | |
tree | f850aa5b9d02e4581ada37685d1cec648d8832e0 | |
parent | 50a2bc5429f07ec4d53df2d287b03bdbceb281bb (diff) | |
parent | df45c712d1f4ef37714245fb75de726f4ca2bf8d (diff) | |
download | linux-c8d150761ca6d1266cbcdc1a64529759b5b6068e.tar.xz |
Merge branches 'acpi-ac' and 'acpi-tpm'
* acpi-ac:
ACPI / AC: change notification handler type to ACPI_ALL_NOTIFY
* acpi-tpm:
ACPI / TPM: fix memory leak when walking ACPI namespace
-rw-r--r-- | drivers/char/tpm/tpm_ppi.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/char/tpm/tpm_ppi.c b/drivers/char/tpm/tpm_ppi.c index 8e562dc..e1f3337 100644 --- a/drivers/char/tpm/tpm_ppi.c +++ b/drivers/char/tpm/tpm_ppi.c @@ -27,15 +27,18 @@ static char *tpm_device_name = "TPM"; static acpi_status ppi_callback(acpi_handle handle, u32 level, void *context, void **return_value) { - acpi_status status; + acpi_status status = AE_OK; struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; - status = acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); - if (strstr(buffer.pointer, context) != NULL) { - *return_value = handle; + + if (ACPI_SUCCESS(acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer))) { + if (strstr(buffer.pointer, context) != NULL) { + *return_value = handle; + status = AE_CTRL_TERMINATE; + } kfree(buffer.pointer); - return AE_CTRL_TERMINATE; } - return AE_OK; + + return status; } static inline void ppi_assign_params(union acpi_object params[4], |