public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdePkg/DxeHstiLib: Added checks to improve error handling.
@ 2019-08-26 19:54 Jayanth.Raghuram
  2019-08-27  1:56 ` Liming Gao
  0 siblings, 1 reply; 13+ messages in thread
From: Jayanth.Raghuram @ 2019-08-26 19:54 UTC (permalink / raw)
  To: devel; +Cc: Wei.G.Liu


[-- 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


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-08-30 11:52 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-26 19:54 [PATCH] MdePkg/DxeHstiLib: Added checks to improve error handling Jayanth.Raghuram
2019-08-27  1:56 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox