MdePkg/DxeHstiLib: Added checks to improve error handling.

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>
This commit is contained in:
Jayanth Raghuram 2019-08-29 11:17:09 -05:00 committed by Liming Gao
parent 40db176d9d
commit 17f8c9e97d
1 changed files with 1 additions and 1 deletions

View File

@ -77,7 +77,7 @@ InternalHstiFindAip (
&InfoTypesBuffer,
&InfoTypesBufferCount
);
if (EFI_ERROR (Status)) {
if (EFI_ERROR (Status) || (InfoTypesBuffer == NULL) || (InfoTypesBufferCount == 0)) {
continue;
}