From f35fe5cb97bbdaa6a6967f2fefc3fc1f79680601 Mon Sep 17 00:00:00 2001 From: Amarnath Valluri Date: Fri, 29 Sep 2017 14:10:15 +0300 Subject: tpm-backend: Initialize and free data members in it's own methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Marc-André Lureau Reviewed-by: Stefan Berger Signed-off-by: Stefan Berger --- tpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tpm.c') diff --git a/tpm.c b/tpm.c index abedf3f8ca..b19b1a3257 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)); } } -- cgit v1.2.3