public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: <Jayanth.Raghuram@dell.com>
To: <devel@edk2.groups.io>
Cc: <Wei.G.Liu@dell.com>
Subject: [PATCH] MdePkg/DxeHstiLib: Added checks to improve error handling.
Date: Mon, 26 Aug 2019 19:54:58 +0000	[thread overview]
Message-ID: <31e5cee5c49d4381bfb26a0968c11749@ausx13mps324.AMER.DELL.COM> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 672 bytes --]

Subject: [PATCH] MdePkg/DxeHstiLib: Added checks to improve error handling.
Added checks for return parameters of LocateHandleBuffer & GetSupportedTypes
function calls in InternalHstiFindAip to improve error handling. An issue was
observed on Dell Poweredge R740, where the Dell PERC H740P controller UEFI
driver returned InfoTypesBuffer = NULL, InfoTypesBufferCount = 0 and caused
an FreePool assert.

Signed-off-by: Jayanth Raghuram <Jayanth.Raghuram@Dell.com>
Cc: Wei G Liu <Wei_G_Liu@Dell.com>

Attached: 0001-MdePkg-DxeHstiLib-Added-checks-to-improve-error-hand.patch

Regards
Jayanth Raghuram
DellEMC | Server Platform BIOS
office + 1 512 723 1470


[-- Attachment #1.2: Type: text/html, Size: 4057 bytes --]

[-- Attachment #2: 0001-MdePkg-DxeHstiLib-Added-checks-to-improve-error-hand.patch --]
[-- Type: application/octet-stream, Size: 1643 bytes --]

From 3006d06fe462fc2a18e872b8b69001d8a74bbb93 Mon Sep 17 00:00:00 2001
Message-Id: <3006d06fe462fc2a18e872b8b69001d8a74bbb93.1566848730.git.Jayanth_Raghuram@Dell.com>
From: Jayanth Raghuram <Jayanth_Raghuram@Dell.com>
Date: Mon, 26 Aug 2019 13:33:52 -0500
Subject: [PATCH] MdePkg/DxeHstiLib: Added checks to improve error handling.
 Added checks for return parameters of LocateHandleBuffer & GetSupportedTypes
 function calls in InternalHstiFindAip to improve error handling. An issue was
 observed on Dell Poweredge R740, where the Dell PERC H740P controller UEFI
 driver returned InfoTypesBuffer = NULL, InfoTypesBufferCount = 0 and caused
 an FreePool assert.

Signed-off-by: Jayanth Raghuram <Jayanth.Raghuram@Dell.com>
Cc: Wei G Liu <Wei_G_Liu@Dell.com>
---
 MdePkg/Library/DxeHstiLib/HstiDxe.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Library/DxeHstiLib/HstiDxe.c b/MdePkg/Library/DxeHstiLib/HstiDxe.c
index 9466e3dcb3..104e9d4aab 100644
--- a/MdePkg/Library/DxeHstiLib/HstiDxe.c
+++ b/MdePkg/Library/DxeHstiLib/HstiDxe.c
@@ -51,7 +51,7 @@ InternalHstiFindAip (
                   &NoHandles,
                   &Handles
                   );
-  if (EFI_ERROR (Status)) {
+  if (EFI_ERROR (Status) || (Handles == NULL) || (NoHandles == 0)) {
     return NULL;
   }
 
@@ -77,7 +77,7 @@ InternalHstiFindAip (
                     &InfoTypesBuffer,
                     &InfoTypesBufferCount
                     );
-    if (EFI_ERROR (Status)) {
+    if (EFI_ERROR (Status) || (InfoTypesBuffer == NULL) || (InfoTypesBufferCount == 0)) {
       continue;
     }
 
-- 
2.19.1.windows.1


             reply	other threads:[~2019-08-26 19:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-26 19:54 Jayanth.Raghuram [this message]
2019-08-27  1:56 ` [PATCH] MdePkg/DxeHstiLib: Added checks to improve error handling Liming Gao
2019-08-27 18:29   ` Jayanth.Raghuram
2019-08-28  7:59     ` Liming Gao
2019-08-28 17:33       ` [edk2-devel] " Ni, Ray
2019-08-29  1:19         ` Jayanth.Raghuram
2019-08-29 14:28           ` Liming Gao
2019-08-29  9:49         ` Leif Lindholm
2019-08-29 14:24           ` Laszlo Ersek
2019-08-29 17:02             ` Ni, Ray
2019-08-30  2:21               ` Nate DeSimone
2019-08-30 11:52                 ` Laszlo Ersek
2019-08-30 11:49               ` Laszlo Ersek

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=31e5cee5c49d4381bfb26a0968c11749@ausx13mps324.AMER.DELL.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