bootloader/efi: remove partition before adding to new list.
* A Node/Partition cannot be member of two lists at once. This resolves an issue where a partition cannot be found later due to corruption of a NodeList.
This commit is contained in:
@@ -488,8 +488,10 @@ platform_get_boot_partitions(struct stage2_args *args, Node *bootDevice,
|
|||||||
NodeIterator iterator = partitions->GetIterator();
|
NodeIterator iterator = partitions->GetIterator();
|
||||||
boot::Partition *partition = NULL;
|
boot::Partition *partition = NULL;
|
||||||
while ((partition = (boot::Partition*)iterator.Next()) != NULL) {
|
while ((partition = (boot::Partition*)iterator.Next()) != NULL) {
|
||||||
if (device_contains_partition((EfiDevice*)bootDevice, partition))
|
if (device_contains_partition((EfiDevice*)bootDevice, partition)) {
|
||||||
|
iterator.Remove();
|
||||||
bootPartitions->Insert(partition);
|
bootPartitions->Insert(partition);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return bootPartitions->Count() > 0 ? B_OK : B_ENTRY_NOT_FOUND;
|
return bootPartitions->Count() > 0 ? B_OK : B_ENTRY_NOT_FOUND;
|
||||||
|
|||||||
Reference in New Issue
Block a user