From bcfd16fe26d6bb6eabfd2dfb46b9fda59d5493db Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Thu, 25 Jul 2019 06:29:39 -0400 Subject: tpm: Exit in reset when backend indicates failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Exit() in the frontend reset function when the backend indicates intialization failure. Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau --- hw/tpm/tpm_tis.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'hw/tpm/tpm_tis.c') diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c index 174618ac30..d6b3212890 100644 --- a/hw/tpm/tpm_tis.c +++ b/hw/tpm/tpm_tis.c @@ -910,7 +910,9 @@ static void tpm_tis_reset(DeviceState *dev) s->rw_offset = 0; } - tpm_backend_startup_tpm(s->be_driver, s->be_buffer_size); + if (tpm_backend_startup_tpm(s->be_driver, s->be_buffer_size) < 0) { + exit(1); + } } /* persistent state handling */ -- cgit v1.2.3