summaryrefslogtreecommitdiffstats
path: root/EmbeddedPkg/Library
diff options
context:
space:
mode:
authorVladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>2018-09-06 11:55:03 -0700
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2018-09-07 12:23:32 +0200
commitc4709260f62f531eed83673104c7ecd7b6e665b7 (patch)
tree2db56fb374cae5c9bb68112e8d23bddb5820e731 /EmbeddedPkg/Library
parentc783da659915c27437047cad9b5d21b9804388c0 (diff)
downloadedk2-c4709260f62f531eed83673104c7ecd7b6e665b7.tar.gz
edk2-c4709260f62f531eed83673104c7ecd7b6e665b7.tar.bz2
edk2-c4709260f62f531eed83673104c7ecd7b6e665b7.zip
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>
Diffstat (limited to 'EmbeddedPkg/Library')
-rw-r--r--EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.c6
1 files changed, 6 insertions, 0 deletions
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;