mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-07 19:45:07 +02:00
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>
This commit is contained in:
parent
6fe575d052
commit
6743455e34
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user