From d8982b0303e75c7fe1c5aab58ac45d3659494fff Mon Sep 17 00:00:00 2001 From: erictian Date: Wed, 21 Dec 2011 06:04:56 +0000 Subject: 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 --- MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'MdeModulePkg') diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c index 72196a0..2494c6a 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; -- cgit v1.1