mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:37:35 +00:00
AHCIController: Fix off-by-one mistake (#7144)
Fixes off-by-one caused by reading the register directly without adding a 1 to it, because AHCI reports 1 less port than the actual number of ports supported.
This commit is contained in:
parent
0fb96e6cbf
commit
88a997871e
1 changed files with 1 additions and 1 deletions
|
@ -183,7 +183,7 @@ RefPtr<StorageDevice> AHCIController::device_by_port(u32 port_index) const
|
|||
RefPtr<StorageDevice> AHCIController::device(u32 index) const
|
||||
{
|
||||
NonnullRefPtrVector<StorageDevice> connected_devices;
|
||||
for (size_t index = 0; index < (size_t)(hba().control_regs.cap & 0x1F); index++) {
|
||||
for (size_t index = 0; index < capabilities().ports_count; index++) {
|
||||
auto checked_device = device_by_port(index);
|
||||
if (checked_device.is_null())
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue