Fix AHCI memory de-allocation issue

This patch fixed the pointer check before de-allocating memory
previously allocated for AHCI controller.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This commit is contained in:
Maurice Ma 2019-10-12 11:37:47 -07:00
parent ecc370113d
commit d23d7e07f8
1 changed files with 2 additions and 2 deletions

View File

@ -297,14 +297,14 @@ AhciDeinitialize (
);
}
if (AhciRegisters->AhciCommandTable != NULL) {
if (AhciRegisters->AhciCmdList != NULL) {
FreePages (
AhciRegisters->AhciCmdList,
EFI_SIZE_TO_PAGES ((UINTN) AhciRegisters->MaxCommandListSize)
);
}
if (AhciRegisters->AhciCommandTable != NULL) {
if (AhciRegisters->AhciRFis != NULL) {
FreePages (
AhciRegisters->AhciRFis,
EFI_SIZE_TO_PAGES ((UINTN) AhciRegisters->MaxReceiveFisSize)