summaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm/tpm_acpi.c
Commit message (Collapse)AuthorAgeFilesLines
* tpm: Do not dereference NULL pointer if acpi_os_map_memory() fails.Jesper Juhl2012-08-221-0/+5
| | | | | | | | | | | | | | | | In drivers/char/tpm/tpm_acpi.c::read_log() we call acpi_os_map_memory(). That call may fail for a number of reasons (invalid address, out of memory etc). If the call fails it returns NULL and we just pass that to memcpy() unconditionally, which will go bad when it tries to dereference the pointer. Unfortunately we just get NULL back, so we can't really tell the user exactely what went wrong, but we can at least avoid crashing and return an error (-EIO seemed more generic and more suitable here than -ENOMEM or something else, so I picked that). Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Kent Yoder <key@linux.vnet.ibm.com>
* tpm: modularize event log collectionKent Yoder2012-08-221-0/+104
Break ACPI-specific pieces of the event log handling into their own file and create tpm_eventlog.[ch] to store common event log handling code. This will be required to integrate future event log sources on platforms without ACPI tables. Signed-off-by: Kent Yoder <key@linux.vnet.ibm.com>