dTPM: Close TPM interface if PCR extend fails

dTPM interface should get de-initialised regardless of PCR extend
success or failure.

Change-Id: I3879fbff964d231e98bdb5c1e807a85dda0f0d41
Signed-off-by: Mudit Sharma <mudit.sharma@arm.com>
diff --git a/partitions/dtpm_client/dtpm_client.c b/partitions/dtpm_client/dtpm_client.c
index a1dcdf9..385e1ef 100644
--- a/partitions/dtpm_client/dtpm_client.c
+++ b/partitions/dtpm_client/dtpm_client.c
@@ -32,6 +32,7 @@
 
     status = tpm_pcr_extend(&tpm_chip_data, pcr_index, hash_alg, value, hash_size);
     if (status != TPM_SUCCESS) {
+        tpm_interface_close(&tpm_chip_data, 0);
         ERROR("dTPM Client extend failed\n");
         return PSA_ERROR_HARDWARE_FAILURE;
     }