summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--OvmfPkg/SataControllerDxe/SataController.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/OvmfPkg/SataControllerDxe/SataController.c b/OvmfPkg/SataControllerDxe/SataController.c
index e5ee63a0ab..1f84ad034e 100644
--- a/OvmfPkg/SataControllerDxe/SataController.c
+++ b/OvmfPkg/SataControllerDxe/SataController.c
@@ -570,6 +570,8 @@ SataControllerStop (
EFI_STATUS Status;
EFI_IDE_CONTROLLER_INIT_PROTOCOL *IdeInit;
EFI_SATA_CONTROLLER_PRIVATE_DATA *SataPrivateData;
+ EFI_PCI_IO_PROTOCOL *PciIo;
+ UINT64 OriginalPciAttributes;
//
// Open the produced protocol
@@ -589,6 +591,9 @@ SataControllerStop (
SataPrivateData = SATA_CONTROLLER_PRIVATE_DATA_FROM_THIS (IdeInit);
ASSERT (SataPrivateData != NULL);
+ PciIo = SataPrivateData->PciIo;
+ OriginalPciAttributes = SataPrivateData->OriginalPciAttributes;
+
//
// Uninstall the IDE Controller Init Protocol from this instance
//
@@ -616,12 +621,12 @@ SataControllerStop (
//
// Restore original PCI attributes
//
- SataPrivateData->PciIo->Attributes (
- SataPrivateData->PciIo,
- EfiPciIoAttributeOperationSet,
- SataPrivateData->OriginalPciAttributes,
- NULL
- );
+ PciIo->Attributes (
+ PciIo,
+ EfiPciIoAttributeOperationSet,
+ OriginalPciAttributes,
+ NULL
+ );
//
// Close protocols opened by Sata Controller driver