mirror of https://github.com/acidanthera/audk.git
MdeModulePkg: Enhance PCI capability looking up logic to avoid hang
Certain PCI device may have capability pointing to itself. Update LocateCapabilityRegBlock() to break when detecting such loop. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18473 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
d20b06a3af
commit
7d9340a3f0
|
@ -173,6 +173,14 @@ LocateCapabilityRegBlock (
|
|||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
//
|
||||
// Certain PCI device may incorrectly have capability pointing to itself,
|
||||
// break to avoid dead loop.
|
||||
//
|
||||
if (CapabilityPtr == (UINT8) (CapabilityEntry >> 8)) {
|
||||
break;
|
||||
}
|
||||
|
||||
CapabilityPtr = (UINT8) (CapabilityEntry >> 8);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue