Kernel/AHCI: Reorder complete_current_request

Clear the m_current_request before signalling the end of request.
This commit is contained in:
Liav A 2021-03-19 19:19:15 +02:00 committed by Andreas Kling
parent cfc2f33dcb
commit 2ae9de77bb
Notes: sideshowbarker 2024-07-18 21:11:38 +09:00

View file

@ -498,8 +498,9 @@ void AHCIPort::start_request(AsyncBlockDeviceRequest& request)
void AHCIPort::complete_current_request(AsyncDeviceRequest::RequestResult result)
{
VERIFY(m_current_request);
m_current_request->complete(result);
auto current_request = m_current_request;
m_current_request.clear();
current_request->complete(result);
}
bool AHCIPort::spin_until_ready() const
@ -520,7 +521,6 @@ bool AHCIPort::spin_until_ready() const
bool AHCIPort::access_device(AsyncBlockDeviceRequest::RequestType direction, u64 lba, u8 block_count)
{
VERIFY(m_lock.is_locked());
VERIFY(m_connected_device);
VERIFY(is_operable());
VERIFY(m_lock.is_locked());