Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14733
6f19259b-4bc3-4df7-8a09-
765794883524
TempNewDevicePath = CachedDevicePath;\r
CachedDevicePath = BdsLibDelPartMatchInstance (CachedDevicePath, BlockIoDevicePath);\r
FreePool(TempNewDevicePath);\r
TempNewDevicePath = CachedDevicePath;\r
CachedDevicePath = BdsLibDelPartMatchInstance (CachedDevicePath, BlockIoDevicePath);\r
FreePool(TempNewDevicePath);\r
- TempNewDevicePath = CachedDevicePath;\r
- CachedDevicePath = AppendDevicePathInstance (BlockIoDevicePath, CachedDevicePath);\r
- if (TempNewDevicePath != NULL) {\r
- FreePool(TempNewDevicePath);\r
- }\r
- } else {\r
+ if (CachedDevicePath != NULL) {\r
TempNewDevicePath = CachedDevicePath;\r
CachedDevicePath = AppendDevicePathInstance (BlockIoDevicePath, CachedDevicePath);\r
FreePool(TempNewDevicePath);\r
TempNewDevicePath = CachedDevicePath;\r
CachedDevicePath = AppendDevicePathInstance (BlockIoDevicePath, CachedDevicePath);\r
FreePool(TempNewDevicePath);\r
+ } else {\r
+ CachedDevicePath = DuplicateDevicePath (BlockIoDevicePath);\r
//\r
// Here limit the device path instance number to 12, which is max number for a system support 3 IDE controller\r
// If the user try to boot many OS in different HDs or partitions, in theory, \r
//\r
// Here limit the device path instance number to 12, which is max number for a system support 3 IDE controller\r
// If the user try to boot many OS in different HDs or partitions, in theory, \r