summaryrefslogtreecommitdiff
path: root/EdkNt32Pkg/Library
diff options
context:
space:
mode:
authorxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>2006-12-14 05:23:10 +0000
committerxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>2006-12-14 05:23:10 +0000
commit4ef4e1eab529c7d23100643705ee0df0b027f12c (patch)
tree7e72f1e6716b6319e6bb15f9b377a2bf83316e39 /EdkNt32Pkg/Library
parent4ef346cd4e3761bc1e8e11166a3bf8859c88ae34 (diff)
downloadedk2-platforms-4ef4e1eab529c7d23100643705ee0df0b027f12c.tar.xz
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
Diffstat (limited to 'EdkNt32Pkg/Library')
-rw-r--r--EdkNt32Pkg/Library/EdkGenericBdsLib/BdsMisc.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/EdkNt32Pkg/Library/EdkGenericBdsLib/BdsMisc.c b/EdkNt32Pkg/Library/EdkGenericBdsLib/BdsMisc.c
index def31023c0..b88d05127a 100644
--- a/EdkNt32Pkg/Library/EdkGenericBdsLib/BdsMisc.c
+++ b/EdkNt32Pkg/Library/EdkGenericBdsLib/BdsMisc.c
@@ -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;