mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
tpm2: fix tpm_write() error reporting
The code misses the cases when a response was received but the command failed. This patch fixes the problem. BRANCH=none BUG=chrome-os-partner:50645 TEST=none Change-Id: I914ab6509d3ab2082152652205802201a6637fcc Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/358096 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
347ff17b97
commit
8f4d6185e1
1 changed files with 5 additions and 5 deletions
|
@ -246,12 +246,12 @@ uint32_t tlcl_write(uint32_t index, const void *data, uint32_t length)
|
|||
|
||||
response = tpm_process_command(TPM2_NV_Write, &nv_writec);
|
||||
|
||||
/* Need to map tpm error codes into internal values. */
|
||||
if (!response)
|
||||
return TPM_E_WRITE_FAILURE;
|
||||
printk(BIOS_INFO, "%s: response is %x\n",
|
||||
__func__, response ? response->hdr.tpm_code : -1);
|
||||
|
||||
printk(BIOS_INFO, "%s:%d return code %x\n", __func__, __LINE__,
|
||||
response->hdr.tpm_code);
|
||||
/* Need to map tpm error codes into internal values. */
|
||||
if (!response || response->hdr.tpm_code)
|
||||
return TPM_E_WRITE_FAILURE;
|
||||
|
||||
return TPM_SUCCESS;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue