public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Sasikanth Valaparla" <sasikanth.valaparla@intel.com>
To: devel@edk2.groups.io
Cc: Sasikanth Valaparla <sasikanth.valaparla@intel.com>,
	S, Bhavana <bhavana.s@intel.com>,
	Yasmin, Tabassum <tabassum.yasmin@intel.com>
Subject: [edk2-devel] [PATCH] MdeModulePkg: FirmwarePerformanceCommonEntryPoint error handling
Date: Tue, 27 Feb 2024 10:04:15 +0530	[thread overview]
Message-ID: <2e7b1232df99b3b46edfc000ca69a2170afb23a7.1708931471.git.sasikanth.valaparla@intel.com> (raw)

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4651

In FirmwarePerformanceCommonEntryPoint there is a MmLocateProtocol
which will locate the gEfiMmRscHandlerProtocolGuid and then
ASSERT_EFI_ERROR(Status) if the locate protocol fails when build is
debug enabled.

if the build is debug disabled then code will execute - register the
report status code using the API provided by
gEfiMmRscHandlerProtocolGuid.

Adding a proper error handling mechanism to handle the error gracefully
when debug is not enabled and to properly report the error if it cannot
continue.

Signed-off-by: Sasikanth Valaparla <sasikanth.valaparla@intel.com>
---
 .../FirmwarePerformanceCommon.c                              | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/FirmwarePerformanceCommon.c b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/FirmwarePerformanceCommon.c
index 9046896c55..7b13215ade 100644
--- a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/FirmwarePerformanceCommon.c
+++ b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableSmm/FirmwarePerformanceCommon.c
@@ -152,7 +152,10 @@ FirmwarePerformanceCommonEntryPoint (
                     NULL,
                     (VOID **)&mRscHandlerProtocol
                     );
-  ASSERT_EFI_ERROR (Status);
+  if (EFI_ERROR(Status)) {
+    ASSERT_EFI_ERROR (Status);
+    return Status;
+  }
 
   //
   // Register report status code listener for BootRecords and S3 Suspend Start and End.
-- 
2.26.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116036): https://edk2.groups.io/g/devel/message/116036
Mute This Topic: https://groups.io/mt/104601540/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



                 reply	other threads:[~2024-02-27 12:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2e7b1232df99b3b46edfc000ca69a2170afb23a7.1708931471.git.sasikanth.valaparla@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox