mirror of https://github.com/acidanthera/audk.git
Original BdsLibMatchDevicePaths() excludes end node when comparing 2 devices paths. When a short device path is the part of a long device path, the function would mistakenly recognize them as same device paths.
So it should compare the entire device path, including the end node. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2099 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
4ef346cd4e
commit
4ef4e1eab5
|
@ -688,7 +688,6 @@ Returns:
|
|||
|
||||
DevicePath = Multi;
|
||||
DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size);
|
||||
Size -= sizeof (EFI_DEVICE_PATH_PROTOCOL);
|
||||
|
||||
//
|
||||
// Search for the match of 'Single' in 'Multi'
|
||||
|
@ -698,17 +697,13 @@ Returns:
|
|||
// If the single device path is found in multiple device paths,
|
||||
// return success
|
||||
//
|
||||
if (Size == 0) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (CompareMem (Single, DevicePathInst, Size) == 0) {
|
||||
gBS->FreePool (DevicePathInst);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gBS->FreePool (DevicePathInst);
|
||||
DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size);
|
||||
Size -= sizeof (EFI_DEVICE_PATH_PROTOCOL);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
|
Loading…
Reference in New Issue