Skip to contentSkip to conversation

tpm: Set the flags of the CMD_INIT command to 0

PATCH In review Stefan Berger 2 participants 2 messages Jan 22, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tpm: Set the flags of the CMD_INIT command to 0

The flags of the CMD_INIT control channel command were not initialized properly. Fix this and set to 0.

---
 hw/tpm/tpm_emulator.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
hw/tpm/tpm_emulator.c +3 -1
index 35c78de..532d3e3 100644
@@ -320,7 +320,9 @@ static int tpm_emulator_set_buffer_size(TPMBackend *tb,
 static int tpm_emulator_startup_tpm(TPMBackend *tb, size_t buffersize)
 {
     TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
-    ptm_init init;
+    ptm_init init = {
+        .u.req.init_flags = 0,
+    };
     ptm_res res;
 
     if (buffersize != 0 &&
Signature · 1 line
2.5.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Stefan Berger

The flags of the CMD_INIT control channel command were not initialized properly. Fix this and set to 0.

Quoted 23 lines
---
 hw/tpm/tpm_emulator.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
hw/tpm/tpm_emulator.c +3 -2
index 35c78de..532d3e3 100644
@@ -320,7 +320,9 @@ static int tpm_emulator_set_buffer_size(TPMBackend *tb,
 static int tpm_emulator_startup_tpm(TPMBackend *tb, size_t buffersize)
 {
     TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
-    ptm_init init;
+    ptm_init init = {
+        .u.req.init_flags = 0,
+    };
     ptm_res res;
 
     if (buffersize != 0 &&
--

2.5.5

Signature · 1 line
Marc-André Lureau