]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg/DxeHstiLib: Added checks to improve error handling.
authorJayanth Raghuram <Jayanth_Raghuram@Dell.com>
Thu, 29 Aug 2019 16:17:09 +0000 (11:17 -0500)
committerLiming Gao <liming.gao@intel.com>
Mon, 2 Sep 2019 04:17:56 +0000 (12:17 +0800)
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2138

Added checks for return parameters of 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>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdePkg/Library/DxeHstiLib/HstiDxe.c

index 9466e3dcb3a856953acef3a2d636254ef222739f..4e1c67616b0123a79dbc13058f2d47445b62c950 100644 (file)
@@ -77,7 +77,7 @@ InternalHstiFindAip (
                     &InfoTypesBuffer,\r
                     &InfoTypesBufferCount\r
                     );\r
-    if (EFI_ERROR (Status)) {\r
+    if (EFI_ERROR (Status) || (InfoTypesBuffer == NULL) || (InfoTypesBufferCount == 0)) {\r
       continue;\r
     }\r
 \r