aboutsummaryrefslogtreecommitdiff
path: root/tpm.c
diff options
context:
space:
mode:
authorAmarnath Valluri <amarnath.valluri@intel.com>2017-09-29 14:10:15 +0300
committerStefan Berger <stefanb@linux.vnet.ibm.com>2017-10-13 07:34:33 -0400
commitf35fe5cb97bbdaa6a6967f2fefc3fc1f79680601 (patch)
tree2bbd77327a4d5de1192173a5ec06ffe5ce42a1d1 /tpm.c
parentb19a5eea5a26e9bd83a48c742172d2a6aa8c4180 (diff)
downloadqemu-f35fe5cb97bbdaa6a6967f2fefc3fc1f79680601.zip
qemu-f35fe5cb97bbdaa6a6967f2fefc3fc1f79680601.tar.gz
qemu-f35fe5cb97bbdaa6a6967f2fefc3fc1f79680601.tar.bz2
tpm-backend: Initialize and free data members in it's own methods
Initialize and free TPMBackend data members in it's own instance_init() and instance_finalize methods. Took the opportunity to remove unneeded destroy() method from TpmDriverOps interface as TPMBackend is a Qemu Object, we can use object_unref() inplace of tpm_backend_destroy() to free the backend object, hence removed destroy() from TPMDriverOps interface. Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Diffstat (limited to 'tpm.c')
-rw-r--r--tpm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tpm.c b/tpm.c
index abedf3f..b19b1a3 100644
--- a/tpm.c
+++ b/tpm.c
@@ -157,7 +157,7 @@ void tpm_cleanup(void)
QLIST_FOREACH_SAFE(drv, &tpm_backends, list, next) {
QLIST_REMOVE(drv, list);
- tpm_backend_destroy(drv);
+ object_unref(OBJECT(drv));
}
}