]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkNt32Pkg/Library/EdkGenericBdsLib/BdsMisc.c
Original BdsLibMatchDevicePaths() excludes end node when comparing 2 devices paths...
[mirror_edk2.git] / EdkNt32Pkg / Library / EdkGenericBdsLib / BdsMisc.c
index def31023c04b96de530cd377db8984a088b0fd42..b88d05127a41870a55cdd6852897a3dc7f9d6dfb 100644 (file)
@@ -688,7 +688,6 @@ Returns:
 \r
   DevicePath      = Multi;\r
   DevicePathInst  = GetNextDevicePathInstance (&DevicePath, &Size);\r
-  Size -= sizeof (EFI_DEVICE_PATH_PROTOCOL);\r
 \r
   //\r
   // Search for the match of 'Single' in 'Multi'\r
@@ -698,17 +697,13 @@ Returns:
     // If the single device path is found in multiple device paths,\r
     // return success\r
     //\r
-    if (Size == 0) {\r
-      return FALSE;\r
-    }\r
-\r
     if (CompareMem (Single, DevicePathInst, Size) == 0) {\r
+      gBS->FreePool (DevicePathInst);\r
       return TRUE;\r
     }\r
 \r
     gBS->FreePool (DevicePathInst);\r
     DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size);\r
-    Size -= sizeof (EFI_DEVICE_PATH_PROTOCOL);\r
   }\r
 \r
   return FALSE;\r