diff options
author | Pedro Falcato <pedro.falcato@gmail.com> | 2023-06-01 18:27:31 +0100 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-06-01 18:08:33 +0000 |
commit | 82b81c64643bb08ba5bf928c5861d6e82b12f160 (patch) | |
tree | 07489c1987b490ee6cb5cf44b56634de246ebcfe /MdeModulePkg/Bus | |
parent | 897a2b447e0f71eb0d102ad707f3688c102d9cec (diff) | |
download | edk2-82b81c64643bb08ba5bf928c5861d6e82b12f160.tar.gz edk2-82b81c64643bb08ba5bf928c5861d6e82b12f160.tar.bz2 edk2-82b81c64643bb08ba5bf928c5861d6e82b12f160.zip |
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>
Diffstat (limited to 'MdeModulePkg/Bus')
-rw-r--r-- | MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c | 44 |
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
//
|