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
\r
DevicePath = Multi;\r
DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size);\r
\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
\r
//\r
// Search for the match of 'Single' in 'Multi'\r
// If the single device path is found in multiple device paths,\r
// return success\r
//\r
// 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
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
return TRUE;\r
}\r
\r
gBS->FreePool (DevicePathInst);\r
DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size);\r
- Size -= sizeof (EFI_DEVICE_PATH_PROTOCOL);\r