diff options
author | Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com> | 2018-09-06 11:55:03 -0700 |
---|---|---|
committer | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2018-09-07 12:23:32 +0200 |
commit | c4709260f62f531eed83673104c7ecd7b6e665b7 (patch) | |
tree | 2db56fb374cae5c9bb68112e8d23bddb5820e731 /EmbeddedPkg | |
parent | c783da659915c27437047cad9b5d21b9804388c0 (diff) | |
download | edk2-c4709260f62f531eed83673104c7ecd7b6e665b7.tar.gz |
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')
-rw-r--r-- | EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.c | 6 |
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;
|