tpm: Move tpm_cleanup() to right place
As Emulator TPM backend uses chardev, tpm cleanup should happen before chardev
similar to other vhost-users.
Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
diff --git a/tpm.c b/tpm.c
index 3b8c7ed..3122227 100644
--- a/tpm.c
+++ b/tpm.c
@@ -172,7 +172,6 @@
return -1;
}
- atexit(tpm_cleanup);
return 0;
}
diff --git a/vl.c b/vl.c
index d7c3492..0723835 100644
--- a/vl.c
+++ b/vl.c
@@ -4905,6 +4905,7 @@
res_free();
/* vhost-user must be cleaned up before chardevs. */
+ tpm_cleanup();
net_cleanup();
audio_cleanup();
monitor_cleanup();