XHCI: Check return status of PrepareKernelAccess.

Potentially fixes #15172.
This commit is contained in:
Augustin Cavalier 2019-07-19 21:04:25 -04:00
parent a04ff4c767
commit 2f044f2aa7

View File

@ -848,7 +848,11 @@ XHCI::SubmitNormalRequest(Transfer *transfer)
if (!directionIn) {
TRACE("copying out iov count %ld\n", transfer->VectorCount());
transfer->PrepareKernelAccess();
status_t status = transfer->PrepareKernelAccess();
if (status != B_OK) {
FreeDescriptor(td);
return status;
}
WriteDescriptor(td, transfer->Vector(), transfer->VectorCount());
}
@ -2801,9 +2805,13 @@ XHCI::FinishTransfers()
if (callbackStatus == B_OK) {
if (directionIn && actualLength > 0) {
TRACE("copying in iov count %ld\n", transfer->VectorCount());
transfer->PrepareKernelAccess();
ReadDescriptor(td, transfer->Vector(),
transfer->VectorCount());
status_t status = transfer->PrepareKernelAccess();
if (status == B_OK) {
ReadDescriptor(td, transfer->Vector(),
transfer->VectorCount());
} else {
callbackStatus = status;
}
}
}
transfer->Finished(callbackStatus, actualLength);