EmbeddedPkg/CoherentDmaLib: Fix typo in DmaAlignedBuffer
authorVladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
Thu, 6 Sep 2018 18:55:02 +0000 (11:55 -0700)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 7 Sep 2018 10:21:28 +0000 (12:21 +0200)
The only valid memory types for DmaAlignedBuffer should be
EfiBootServicesData and EfiRuntimeServicesData. However due to the typo,
there is no way to allocate runtime pages, and INVALID_PARAMETER is
always returned. Fix the typo.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.c

index 564db83..8ca9e6a 100644 (file)
@@ -154,7 +154,7 @@ DmaAllocateAlignedBuffer (
   //\r
   if (MemoryType == EfiBootServicesData) {\r
     *HostAddress = AllocateAlignedPages (Pages, Alignment);\r
-  } else if (MemoryType != EfiRuntimeServicesData) {\r
+  } else if (MemoryType == EfiRuntimeServicesData) {\r
     *HostAddress = AllocateAlignedRuntimePages (Pages, Alignment);\r
   } else {\r
     return EFI_INVALID_PARAMETER;\r