summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Bus
diff options
context:
space:
mode:
authorerictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>2011-12-21 06:04:56 +0000
committererictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>2011-12-21 06:04:56 +0000
commitd8982b0303e75c7fe1c5aab58ac45d3659494fff (patch)
tree9c9d2c7bdb539f30ec03b19eb4a716f01d4ec733 /MdeModulePkg/Bus
parentfe2876127550a7c8a0e7d2d0f47203154a5d6969 (diff)
downloadedk2-platforms-d8982b0303e75c7fe1c5aab58ac45d3659494fff.tar.xz
MdeModulePkg: Fix a bug in GetNextTargetLun()/GetNextTarget() when two cdroms attached
Signed-off-by: erictian Reviewed-by: rsun3 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12890 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Bus')
-rw-r--r--MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
index 72196a0040..2494c6abf0 100644
--- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
+++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
@@ -2028,7 +2028,8 @@ ExtScsiPassThruGetNextTargetLun (
if ((DeviceInfo->Type == EfiIdeCdrom) &&
((Target8[0] < DeviceInfo->Port) ||
- (Target8[1] < DeviceInfo->PortMultiplier))) {
+ ((Target8[0] == DeviceInfo->Port) &&
+ (Target8[1] < DeviceInfo->PortMultiplier)))) {
Target8[0] = (UINT8)DeviceInfo->Port;
Target8[1] = (UINT8)DeviceInfo->PortMultiplier;
goto Exit;
@@ -2366,7 +2367,8 @@ ExtScsiPassThruGetNextTarget (
if ((DeviceInfo->Type == EfiIdeCdrom) &&
((Target8[0] < DeviceInfo->Port) ||
- (Target8[1] < DeviceInfo->PortMultiplier))) {
+ ((Target8[0] == DeviceInfo->Port) &&
+ (Target8[1] < DeviceInfo->PortMultiplier)))) {
Target8[0] = (UINT8)DeviceInfo->Port;
Target8[1] = (UINT8)DeviceInfo->PortMultiplier;
goto Exit;