From: Vladimir Olovyannikov Date: Thu, 6 Sep 2018 18:55:02 +0000 (-0700) Subject: EmbeddedPkg/CoherentDmaLib: Fix typo in DmaAlignedBuffer X-Git-Tag: edk2-stable201903~1063 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=c783da659915c27437047cad9b5d21b9804388c0 EmbeddedPkg/CoherentDmaLib: Fix typo in DmaAlignedBuffer 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 Reviewed-by: Ard Biesheuvel --- diff --git a/EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.c b/EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.c index 564db83c90..8ca9e6aa5b 100644 --- a/EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.c +++ b/EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.c @@ -154,7 +154,7 @@ DmaAllocateAlignedBuffer ( // if (MemoryType == EfiBootServicesData) { *HostAddress = AllocateAlignedPages (Pages, Alignment); - } else if (MemoryType != EfiRuntimeServicesData) { + } else if (MemoryType == EfiRuntimeServicesData) { *HostAddress = AllocateAlignedRuntimePages (Pages, Alignment); } else { return EFI_INVALID_PARAMETER;