[USBPORT] Release StateChangeSpinLock before acquiring MiniportSpinLock.

Found by Driver Verifier.
This commit is contained in:
Thomas Faber 2019-03-05 22:27:15 +01:00
parent 267f5633ee
commit e47240fb37
No known key found for this signature in database
GPG key ID: 076E7C3D44720826

View file

@ -1252,6 +1252,7 @@ USBPORT_ReopenPipe(IN PDEVICE_OBJECT FdoDevice,
if (Endpoint->StateLast == USBPORT_ENDPOINT_ACTIVE) if (Endpoint->StateLast == USBPORT_ENDPOINT_ACTIVE)
{ {
KeReleaseSpinLockFromDpcLevel(&Endpoint->StateChangeSpinLock);
KeAcquireSpinLockAtDpcLevel(&FdoExtension->MiniportSpinLock); KeAcquireSpinLockAtDpcLevel(&FdoExtension->MiniportSpinLock);
Packet->SetEndpointState(FdoExtension->MiniPortExt, Packet->SetEndpointState(FdoExtension->MiniPortExt,
@ -1260,8 +1261,11 @@ USBPORT_ReopenPipe(IN PDEVICE_OBJECT FdoDevice,
KeReleaseSpinLockFromDpcLevel(&FdoExtension->MiniportSpinLock); KeReleaseSpinLockFromDpcLevel(&FdoExtension->MiniportSpinLock);
} }
else
{
KeReleaseSpinLockFromDpcLevel(&Endpoint->StateChangeSpinLock);
}
KeReleaseSpinLockFromDpcLevel(&Endpoint->StateChangeSpinLock);
KeReleaseSpinLock(&Endpoint->EndpointSpinLock, Endpoint->EndpointOldIrql); KeReleaseSpinLock(&Endpoint->EndpointSpinLock, Endpoint->EndpointOldIrql);
} }