mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
Kernel: Use correctly-sized read when checking PCI host bridge function
We were accidentally doing a 16-bit read instead of an 8-bit read, meaning we would also read the 'CACHE_LINE_SIZE' field immediately following it, and never actually continue.
This commit is contained in:
parent
c4750f6eec
commit
519be6e626
Notes:
sideshowbarker
2024-07-16 23:59:28 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/519be6e626 Pull-request: https://github.com/SerenityOS/serenity/pull/24072 Reviewed-by: https://github.com/spholz
1 changed files with 1 additions and 1 deletions
|
@ -121,7 +121,7 @@ UNMAP_AFTER_INIT void HostController::enumerate_attached_devices(Function<Iterat
|
|||
for (int bus_as_function_number = 1; bus_as_function_number < 8; ++bus_as_function_number) {
|
||||
if (read16_field(0, 0, bus_as_function_number, PCI::RegisterOffset::VENDOR_ID) == PCI::none_value)
|
||||
continue;
|
||||
if (read16_field(0, 0, bus_as_function_number, PCI::RegisterOffset::CLASS) != 0x6)
|
||||
if (read8_field(0, 0, bus_as_function_number, PCI::RegisterOffset::CLASS) != 0x6)
|
||||
continue;
|
||||
if (Checked<u8>::addition_would_overflow(m_domain.start_bus(), bus_as_function_number))
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue