summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c44
1 files changed, 21 insertions, 23 deletions
diff --git a/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c b/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c
index 277bc6182d..f0ffd311d7 100644
--- a/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c
+++ b/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c
@@ -626,34 +626,32 @@ SataControllerStop (
return Status;
}
- if (Private != NULL) {
- if (Private->DisqualifiedModes != NULL) {
- FreePool (Private->DisqualifiedModes);
- }
-
- if (Private->IdentifyData != NULL) {
- FreePool (Private->IdentifyData);
- }
+ if (Private->DisqualifiedModes != NULL) {
+ FreePool (Private->DisqualifiedModes);
+ }
- if (Private->IdentifyValid != NULL) {
- FreePool (Private->IdentifyValid);
- }
+ if (Private->IdentifyData != NULL) {
+ FreePool (Private->IdentifyData);
+ }
- if (Private->PciAttributesChanged) {
- //
- // Restore original PCI attributes
- //
- Private->PciIo->Attributes (
- Private->PciIo,
- EfiPciIoAttributeOperationSet,
- Private->OriginalPciAttributes,
- NULL
- );
- }
+ if (Private->IdentifyValid != NULL) {
+ FreePool (Private->IdentifyValid);
+ }
- FreePool (Private);
+ if (Private->PciAttributesChanged) {
+ //
+ // Restore original PCI attributes
+ //
+ Private->PciIo->Attributes (
+ Private->PciIo,
+ EfiPciIoAttributeOperationSet,
+ Private->OriginalPciAttributes,
+ NULL
+ );
}
+ FreePool (Private);
+
//
// Close protocols opened by Sata Controller driver
//