XHCI: Check return status of PrepareKernelAccess.
Potentially fixes #15172.
This commit is contained in:
@@ -848,7 +848,11 @@ XHCI::SubmitNormalRequest(Transfer *transfer)
|
|||||||
|
|
||||||
if (!directionIn) {
|
if (!directionIn) {
|
||||||
TRACE("copying out iov count %ld\n", transfer->VectorCount());
|
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());
|
WriteDescriptor(td, transfer->Vector(), transfer->VectorCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2801,9 +2805,13 @@ XHCI::FinishTransfers()
|
|||||||
if (callbackStatus == B_OK) {
|
if (callbackStatus == B_OK) {
|
||||||
if (directionIn && actualLength > 0) {
|
if (directionIn && actualLength > 0) {
|
||||||
TRACE("copying in iov count %ld\n", transfer->VectorCount());
|
TRACE("copying in iov count %ld\n", transfer->VectorCount());
|
||||||
transfer->PrepareKernelAccess();
|
status_t status = transfer->PrepareKernelAccess();
|
||||||
|
if (status == B_OK) {
|
||||||
ReadDescriptor(td, transfer->Vector(),
|
ReadDescriptor(td, transfer->Vector(),
|
||||||
transfer->VectorCount());
|
transfer->VectorCount());
|
||||||
|
} else {
|
||||||
|
callbackStatus = status;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
transfer->Finished(callbackStatus, actualLength);
|
transfer->Finished(callbackStatus, actualLength);
|
||||||
|
|||||||
Reference in New Issue
Block a user