EmbeddedPkg/CoherentDmaLib: Add missing checks to DmaMap
[mirror_edk2.git] / EmbeddedPkg / Library / CoherentDmaLib / CoherentDmaLib.c
index 8ca9e6a..eb88fa2 100644 (file)
@@ -58,6 +58,12 @@ DmaMap (
   OUT    VOID                           **Mapping\r
   )\r
 {\r
+  if (HostAddress == NULL ||\r
+      NumberOfBytes == NULL ||\r
+      DeviceAddress == NULL ||\r
+      Mapping == NULL ) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
   *DeviceAddress = HostToDeviceAddress (HostAddress);\r
   *Mapping = NULL;\r
   return EFI_SUCCESS;\r