From c783da659915c27437047cad9b5d21b9804388c0 Mon Sep 17 00:00:00 2001 From: Vladimir Olovyannikov Date: Thu, 6 Sep 2018 11:55:02 -0700 Subject: [PATCH 1/1] 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 --- EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.39.2