mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:17:45 +00:00
Kernel/Storage: Add device null check in AHCIPort::handle_interrupt()
Before attempting to remove the device while handling an AHCI port interrupt, check if m_connected_device is even non-null. This happened during my bare metal run and caused a kernel panic.
This commit is contained in:
parent
371d49c0f6
commit
d8fb3290d5
1 changed files with 1 additions and 1 deletions
|
@ -73,7 +73,7 @@ void AHCIPort::handle_interrupt()
|
||||||
}
|
}
|
||||||
if (m_interrupt_status.is_set(AHCI::PortInterruptFlag::PRC) && m_interrupt_status.is_set(AHCI::PortInterruptFlag::PC)) {
|
if (m_interrupt_status.is_set(AHCI::PortInterruptFlag::PRC) && m_interrupt_status.is_set(AHCI::PortInterruptFlag::PC)) {
|
||||||
clear_sata_error_register();
|
clear_sata_error_register();
|
||||||
if ((m_port_registers.ssts & 0xf) != 3) {
|
if ((m_port_registers.ssts & 0xf) != 3 && m_connected_device) {
|
||||||
m_connected_device->prepare_for_unplug();
|
m_connected_device->prepare_for_unplug();
|
||||||
StorageManagement::the().remove_device(*m_connected_device);
|
StorageManagement::the().remove_device(*m_connected_device);
|
||||||
g_io_work->queue([this]() {
|
g_io_work->queue([this]() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue