EmbeddedPkg/CoherentDmaLib: Add missing checks to DmaMap

UEFI Sct validates Dma mapping. For CoherentDmaLib it always failed
because there were no required checks present in DmaMap.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
This commit is contained in:
Vladimir Olovyannikov 2018-09-06 11:55:03 -07:00 committed by Ard Biesheuvel
parent c783da6599
commit c4709260f6
1 changed files with 6 additions and 0 deletions

View File

@ -58,6 +58,12 @@ DmaMap (
OUT VOID **Mapping
)
{
if (HostAddress == NULL ||
NumberOfBytes == NULL ||
DeviceAddress == NULL ||
Mapping == NULL ) {
return EFI_INVALID_PARAMETER;
}
*DeviceAddress = HostToDeviceAddress (HostAddress);
*Mapping = NULL;
return EFI_SUCCESS;