summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorjji4 <jji4@6f19259b-4bc3-4df7-8a09-765794883524>2009-02-03 06:11:04 +0000
committerjji4 <jji4@6f19259b-4bc3-4df7-8a09-765794883524>2009-02-03 06:11:04 +0000
commit1068a653744748b71deea1fe4b09e99d4ebe67e8 (patch)
tree8a5058b67fbafaca21fb963e409976ba645cf100 /MdeModulePkg
parentd089bd5ffe345fd3584cbf4a6866df02efaa47aa (diff)
downloadedk2-1068a653744748b71deea1fe4b09e99d4ebe67e8.zip
edk2-1068a653744748b71deea1fe4b09e99d4ebe67e8.tar.gz
edk2-1068a653744748b71deea1fe4b09e99d4ebe67e8.tar.bz2
Code size optimized
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7415 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c
index 654e5c0..f428214 100644
--- a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c
+++ b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c
@@ -1001,10 +1001,6 @@ ScsiScanCreateDevice (
ScsiIoDevice->Lun,
&ScsiDevicePath
);
- if (Status == EFI_OUT_OF_RESOURCES) {
- FreePool (ScsiIoDevice);
- return Status;
- }
} else {
Status = ScsiIoDevice->ScsiPassThru->BuildDevicePath (
ScsiIoDevice->ScsiPassThru,
@@ -1012,10 +1008,11 @@ ScsiScanCreateDevice (
ScsiIoDevice->Lun,
&ScsiDevicePath
);
- if (Status == EFI_OUT_OF_RESOURCES) {
- FreePool (ScsiIoDevice);
- return Status;
- }
+ }
+
+ if (Status == EFI_OUT_OF_RESOURCES) {
+ FreePool (ScsiIoDevice);
+ return Status;
}
ScsiIoDevice->DevicePath = AppendDevicePathNode (
@@ -1043,6 +1040,7 @@ ScsiScanCreateDevice (
NULL
);
if (EFI_ERROR (Status)) {
+ FreePool (ScsiIoDevice->DevicePath);
FreePool (ScsiIoDevice);
return EFI_OUT_OF_RESOURCES;
} else {