]> git.proxmox.com Git - mirror_edk2.git/commitdiff
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 564db83c901c0a80a78fed729c0d5caacabf6f42..8ca9e6aa5b1b0ba233cf78cc70e74bf29dba8cbd 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