]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/Tcg/TcgDxe/TisDxe.c
Add Missing invocations to VA_END() for VA_START().
[mirror_edk2.git] / SecurityPkg / Tcg / TcgDxe / TisDxe.c
index 635ff77e13c7145ecaa5326949b2fc2eecb2cedc..68489d3e3f1ce29ef005324df32b459b8fa91d06 100644 (file)
@@ -1,7 +1,7 @@
 /** @file  \r
   TIS (TPM Interface Specification) functions used by TPM Dxe driver.\r
   \r
-Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials \r
 are licensed and made available under the terms and conditions of the BSD License \r
 which accompanies this distribution.  The full text of the license may be found at \r
@@ -376,7 +376,7 @@ TisPcExecute (
     if (*Fmt == '/') break;\r
     Status = TisPcSendV (*Fmt, &Ap, TpmCommandBuf, &BufSize);\r
     if (EFI_ERROR( Status )) {\r
-      return Status;\r
+      goto Error;\r
     }\r
     Fmt++;\r
   }\r
@@ -389,7 +389,7 @@ TisPcExecute (
     // Ensure the TPM state change from "Reception" to "Idle/Ready"\r
     //\r
     MmioWrite8 ((UINTN) &(((TIS_PC_REGISTERS_PTR) TisReg)->Status), TIS_PC_STS_READY);\r
-    return Status; \r
+    goto Error;\r
   }\r
 \r
   MmioWrite8 ((UINTN) &(((TIS_PC_REGISTERS_PTR) TisReg)->Status), TIS_PC_STS_GO);\r
@@ -404,7 +404,7 @@ TisPcExecute (
   //\r
   MmioWrite8 ((UINTN) &(((TIS_PC_REGISTERS_PTR) TisReg)->Status), TIS_PC_STS_READY);\r
   if (EFI_ERROR (Status)) {\r
-    return Status;\r
+    goto Error;\r
   }\r
   \r
   //\r
@@ -418,14 +418,16 @@ TisPcExecute (
     }\r
     Status = TisPcReceiveV (*Fmt, &Ap, TpmCommandBuf, &BufSize, ResponseSize, &DataFinished);\r
     if (EFI_ERROR (Status)) {\r
-      return Status;\r
+      goto Error;\r
     }\r
     if (DataFinished) {\r
+      VA_END (Ap);\r
       return EFI_SUCCESS;\r
     }\r
     Fmt++;\r
   }\r
 \r
+Error:\r
   VA_END (Ap);\r
   return Status;\r
 }\r