diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2017-11-04 21:32:37 +0000 |
---|---|---|
committer | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2017-11-06 10:33:02 +0000 |
commit | 6743455e34d1b313d644d9f7ca726b9932effb1f (patch) | |
tree | fad6a7c4c0a944c5ed80717af224184f198d20d9 | |
parent | 6fe575d052e36b243657a5885b5457decac41f03 (diff) | |
download | edk2-6743455e34d1b313d644d9f7ca726b9932effb1f.zip edk2-6743455e34d1b313d644d9f7ca726b9932effb1f.tar.gz edk2-6743455e34d1b313d644d9f7ca726b9932effb1f.tar.bz2 |
MdeModulePkg/SdMmcPciHcDxe: call SdMmcFreeTrb() to complete sync operation
Currently, we complete a synchronous operation without unmapping the
DMA mappings, and free the pages using FreePages () rather than calling
EFI_PCI_IO_PROTOCOL::FreeBuffer. This is simply incorrect, but it also
breaks non-coherent DMA as well as DMA protection and/or memory encryption
so let's do it correctly and call SdMmcFreeTrb() instead.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
-rw-r--r-- | MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c index 23faec5..0be8828 100644 --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c @@ -1008,13 +1008,7 @@ SdMmcPassThruPassThru ( }
Done:
- if ((Trb != NULL) && (Trb->AdmaDesc != NULL)) {
- FreePages (Trb->AdmaDesc, Trb->AdmaPages);
- }
-
- if (Trb != NULL) {
- FreePool (Trb);
- }
+ SdMmcFreeTrb (Trb);
return Status;
}
|