From: Vladimir Olovyannikov Date: Thu, 6 Sep 2018 18:55:03 +0000 (-0700) Subject: EmbeddedPkg/CoherentDmaLib: Add missing checks to DmaMap X-Git-Tag: edk2-stable201903~1062 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=c4709260f62f531eed83673104c7ecd7b6e665b7 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 Reviewed-by: Ard Biesheuvel --- diff --git a/EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.c b/EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.c index 8ca9e6aa5b..eb88fa288a 100644 --- a/EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.c +++ b/EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.c @@ -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;