TempNewDevicePath = CachedDevicePath;\r
CachedDevicePath = BdsLibDelPartMatchInstance (CachedDevicePath, BlockIoDevicePath);\r
FreePool(TempNewDevicePath);\r
+ }\r
\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
+ } else {\r
+ CachedDevicePath = DuplicateDevicePath (BlockIoDevicePath);\r
}\r
+\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