UPSTREAM: drivers/i2c/tpm: Fix error handling for tis structure not initialized
If the TPM completely fails to respond then the vendor structure may not have assigned handlers yet, so catch that case and return error so the boot can continue to recovery mode instead of asserting over and over. BUG=None BRANCH=None TEST=None Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://review.coreboot.org/16416 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Change-Id: If3a11567df89bc73b4d4878bf89d877974044f34 Reviewed-on: https://chromium-review.googlesource.com/382079 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
31c48a5a9a
commit
10d50fe301
1 changed files with 3 additions and 0 deletions
|
|
@ -114,6 +114,9 @@ static ssize_t tpm_transmit(const uint8_t *buf, size_t bufsiz)
|
|||
memcpy(&ordinal, buf + TPM_CMD_ORDINAL_BYTE, sizeof(ordinal));
|
||||
ordinal = be32_to_cpu(ordinal);
|
||||
|
||||
if (!chip->vendor.send || !chip->vendor.status || !chip->vendor.cancel)
|
||||
return -1;
|
||||
|
||||
if (count == 0) {
|
||||
printk(BIOS_DEBUG, "tpm_transmit: no data\n");
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue