diff options
author | Stefan Berger | 2017-10-11 16:36:53 +0200 |
---|---|---|
committer | Stefan Berger | 2017-12-22 15:01:09 +0100 |
commit | b86da7ddeda904b5fb1da03781328e7039536025 (patch) | |
tree | 6f4f1ba0beb82d9d396876979668bab183101e79 /hw/tpm/tpm_util.c | |
parent | tpm_tis: merge r/w_offset into rw_offset (diff) | |
download | qemu-b86da7ddeda904b5fb1da03781328e7039536025.tar.gz qemu-b86da7ddeda904b5fb1da03781328e7039536025.tar.xz qemu-b86da7ddeda904b5fb1da03781328e7039536025.zip |
tpm: Implement tpm_sized_buffer_reset
Move the definition of TPMSizedBuffer out of tpm_tis.c into tpm_util.h
and implement tpm_sized_buffer_reset() for the following patches to use.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'hw/tpm/tpm_util.c')
-rw-r--r-- | hw/tpm/tpm_util.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/tpm/tpm_util.c b/hw/tpm/tpm_util.c index 17cafbe6b3..747075e244 100644 --- a/hw/tpm/tpm_util.c +++ b/hw/tpm/tpm_util.c @@ -355,3 +355,10 @@ int tpm_util_get_buffer_size(int tpm_fd, TPMVersion tpm_version, return 0; } + +void tpm_sized_buffer_reset(TPMSizedBuffer *tsb) +{ + g_free(tsb->buffer); + tsb->buffer = NULL; + tsb->size = 0; +} |