1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:07:47 +00:00

Kernel: Fix incorrect argument when constructing DiskPartitionMetadata

The existing code invokes operator bool for the partition_type
variable.
This commit is contained in:
Gunnar Beutner 2021-05-15 17:15:10 +02:00 committed by Andreas Kling
parent 24376e7759
commit 4b5dbc15df
2 changed files with 3 additions and 9 deletions

View file

@ -64,9 +64,7 @@ EBRPartitionTable::EBRPartitionTable(const StorageDevice& device)
if (entry.offset == 0x00) { if (entry.offset == 0x00) {
continue; continue;
} }
auto partition_type = ByteBuffer::create_zeroed(sizeof(u8)); m_partitions.empend(entry.offset, (entry.offset + entry.length), entry.type);
partition_type.data()[0] = entry.type;
m_partitions.append(DiskPartitionMetadata({ entry.offset, (entry.offset + entry.length), partition_type }));
} }
} }

View file

@ -60,9 +60,7 @@ MBRPartitionTable::MBRPartitionTable(const StorageDevice& device, u32 start_lba)
if (entry.offset == 0x00) { if (entry.offset == 0x00) {
continue; continue;
} }
auto partition_type = ByteBuffer::create_zeroed(sizeof(u8)); m_partitions.empend(entry.offset, (entry.offset + entry.length), entry.type);
partition_type.data()[0] = entry.type;
m_partitions.append(DiskPartitionMetadata({ entry.offset, (entry.offset + entry.length), partition_type }));
} }
m_valid = true; m_valid = true;
} }
@ -81,9 +79,7 @@ MBRPartitionTable::MBRPartitionTable(const StorageDevice& device)
if (entry.offset == 0x00) { if (entry.offset == 0x00) {
continue; continue;
} }
auto partition_type = ByteBuffer::create_zeroed(sizeof(u8)); m_partitions.empend(entry.offset, (entry.offset + entry.length), entry.type);
partition_type.data()[0] = entry.type;
m_partitions.append(DiskPartitionMetadata({ entry.offset, (entry.offset + entry.length), partition_type }));
} }
m_valid = true; m_valid = true;
} }