[USBPORT] USBPORT_InvalidateEndpointHandler(): Properly enumerate endpoints

This commit is contained in:
Serge Gautherie 2019-09-24 07:15:06 +02:00 committed by Victor Perevertkin
parent 220bc820eb
commit ed9f0dca14

View file

@ -1357,9 +1357,9 @@ USBPORT_InvalidateEndpointHandler(IN PDEVICE_OBJECT FdoDevice,
{ {
KeAcquireSpinLock(&FdoExtension->EndpointListSpinLock, &OldIrql); KeAcquireSpinLock(&FdoExtension->EndpointListSpinLock, &OldIrql);
Entry = &FdoExtension->EndpointList; for (Entry = FdoExtension->EndpointList.Flink;
Entry && Entry != &FdoExtension->EndpointList;
while (Entry && Entry != &FdoExtension->EndpointList) Entry = Entry->Flink)
{ {
endpoint = CONTAINING_RECORD(Entry, endpoint = CONTAINING_RECORD(Entry,
USBPORT_ENDPOINT, USBPORT_ENDPOINT,
@ -1376,8 +1376,6 @@ USBPORT_InvalidateEndpointHandler(IN PDEVICE_OBJECT FdoDevice,
IsAddEntry = TRUE; IsAddEntry = TRUE;
} }
} }
Entry = endpoint->EndpointLink.Flink;
} }
KeReleaseSpinLock(&FdoExtension->EndpointListSpinLock, OldIrql); KeReleaseSpinLock(&FdoExtension->EndpointListSpinLock, OldIrql);