From c6cea09e9ad0674bb58e430623407092cdc8ac30 Mon Sep 17 00:00:00 2001 From: Arun Subramanian Baskaran Date: Thu, 23 Oct 2025 22:27:41 -0400 Subject: [PATCH] SecurityPkg: Trace and return status are handled. Added debug trace messages on LocateProtocol failure for gEfiDxeSmmReadyToLockProtocolGuid. Returned device error in case of EfiCreateProtocolNotifyEvent failure. Removed ASSERT due to if condition. Signed-off-by: Arun Subramanian Baskaran --- SecurityPkg/Tcg/Tcg2PlatformDxe/Tcg2PlatformDxe.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SecurityPkg/Tcg/Tcg2PlatformDxe/Tcg2PlatformDxe.c b/SecurityPkg/Tcg/Tcg2PlatformDxe/Tcg2PlatformDxe.c index b9ed6cf8f9..bb479c1771 100644 --- a/SecurityPkg/Tcg/Tcg2PlatformDxe/Tcg2PlatformDxe.c +++ b/SecurityPkg/Tcg/Tcg2PlatformDxe/Tcg2PlatformDxe.c @@ -43,6 +43,7 @@ SmmReadyToLockEventCallBack ( &Interface ); if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Failed to locate gEfiDxeSmmReadyToLockProtocolGuid.\n")); return; } @@ -79,7 +80,10 @@ Tcg2PlatformDxeEntryPoint ( &Registration ); - ASSERT (Event != NULL); + if (Event == NULL) { + DEBUG ((DEBUG_ERROR, "Failed to create protocol notify event for SmmReadyToLockProtocol.\n")); + return EFI_DEVICE_ERROR; + } return EFI_SUCCESS; }