EmbeddedPkg/MmcDxe: Align the ExtCSD buffer

ExtCSD structure may be read via DMA. So align it to
page to avoid data corruption.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jun Nie <jun.nie@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
This commit is contained in:
Jun Nie
2017-07-04 23:43:16 +08:00
committed by Leif Lindholm
parent e4129b0e58
commit 7bb5fad566
3 changed files with 18 additions and 6 deletions

View File

@@ -171,6 +171,9 @@ EFI_STATUS DestroyMmcHostInstance (
if (MmcHostInstance->BlockIo.Media) {
FreePool(MmcHostInstance->BlockIo.Media);
}
if (MmcHostInstance->CardInfo.ECSDData) {
FreePages (MmcHostInstance->CardInfo.ECSDData, EFI_SIZE_TO_PAGES (sizeof (ECSD)));
}
FreePool (MmcHostInstance);
return Status;