MdeModulePkg/SataControllerDxe: Remove useless null check
ASSERT (Private != NULL) already covers this check.
See commit 81310a6.
Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
diff --git a/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c b/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c
index 277bc61..f0ffd31 100644
--- a/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c
+++ b/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c
@@ -626,34 +626,32 @@
return Status;
}
- if (Private != NULL) {
- if (Private->DisqualifiedModes != NULL) {
- FreePool (Private->DisqualifiedModes);
- }
-
- if (Private->IdentifyData != NULL) {
- FreePool (Private->IdentifyData);
- }
-
- if (Private->IdentifyValid != NULL) {
- FreePool (Private->IdentifyValid);
- }
-
- if (Private->PciAttributesChanged) {
- //
- // Restore original PCI attributes
- //
- Private->PciIo->Attributes (
- Private->PciIo,
- EfiPciIoAttributeOperationSet,
- Private->OriginalPciAttributes,
- NULL
- );
- }
-
- FreePool (Private);
+ if (Private->DisqualifiedModes != NULL) {
+ FreePool (Private->DisqualifiedModes);
}
+ if (Private->IdentifyData != NULL) {
+ FreePool (Private->IdentifyData);
+ }
+
+ if (Private->IdentifyValid != NULL) {
+ FreePool (Private->IdentifyValid);
+ }
+
+ 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
//