mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05: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)) {
|
||||
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();
|
||||
StorageManagement::the().remove_device(*m_connected_device);
|
||||
g_io_work->queue([this]() {
|
||||
|
|
Loading…
Add table
Reference in a new issue