sandbox: tpm: Tidy up reading and writing of device state
authorSimon Glass <sjg@chromium.org>
Sun, 18 Jul 2021 20:17:58 +0000 (14:17 -0600)
committerSimon Glass <sjg@chromium.org>
Sun, 1 Aug 2021 15:05:24 +0000 (09:05 -0600)
commit1db235a186c001a50e5f5db9b587bbaa4e397ee7
treec023f64a2ddb6a32033e43243ad8e594efeb22ba
parent974c98f26c765f323433b0c52e02ea3a777bc80f
sandbox: tpm: Tidy up reading and writing of device state

At present this code assumes that the TPM data has been read but this may
not be the case. Refactor the code to use a separate pointer so we know
the current state of the data.

Add error checking for the data size.

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/tpm/tpm_tis_sandbox.c