diff options
-rw-r--r-- | src/drivers/spi/tpm/tis.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/drivers/spi/tpm/tis.c b/src/drivers/spi/tpm/tis.c index d3c727cb27..481c9da1d0 100644 --- a/src/drivers/spi/tpm/tis.c +++ b/src/drivers/spi/tpm/tis.c @@ -85,6 +85,11 @@ int tis_sendrecv(const uint8_t *sendbuf, size_t sbuf_size, uint8_t *recvbuf, size_t *rbuf_len) { int len = tpm2_process_command(sendbuf, sbuf_size, recvbuf, *rbuf_len); + + if (len == 0) + return -1; + *rbuf_len = len; + return 0; } |