From c4709260f62f531eed83673104c7ecd7b6e665b7 Mon Sep 17 00:00:00 2001 From: Vladimir Olovyannikov Date: Thu, 6 Sep 2018 11:55:03 -0700 Subject: [PATCH] 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 --- EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.c | 6 ++++++ 1 file changed, 6 insertions(+) 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; -- 2.39.2