From ed9f0dca14ea2e002868bad30e4f6b6e9dec7e0c Mon Sep 17 00:00:00 2001 From: Serge Gautherie Date: Tue, 24 Sep 2019 07:15:06 +0200 Subject: [PATCH] [USBPORT] USBPORT_InvalidateEndpointHandler(): Properly enumerate endpoints --- drivers/usb/usbport/endpoint.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/usbport/endpoint.c b/drivers/usb/usbport/endpoint.c index 40efddf1652..a31443421c6 100644 --- a/drivers/usb/usbport/endpoint.c +++ b/drivers/usb/usbport/endpoint.c @@ -1357,9 +1357,9 @@ USBPORT_InvalidateEndpointHandler(IN PDEVICE_OBJECT FdoDevice, { KeAcquireSpinLock(&FdoExtension->EndpointListSpinLock, &OldIrql); - Entry = &FdoExtension->EndpointList; - - while (Entry && Entry != &FdoExtension->EndpointList) + for (Entry = FdoExtension->EndpointList.Flink; + Entry && Entry != &FdoExtension->EndpointList; + Entry = Entry->Flink) { endpoint = CONTAINING_RECORD(Entry, USBPORT_ENDPOINT, @@ -1376,8 +1376,6 @@ USBPORT_InvalidateEndpointHandler(IN PDEVICE_OBJECT FdoDevice, IsAddEntry = TRUE; } } - - Entry = endpoint->EndpointLink.Flink; } KeReleaseSpinLock(&FdoExtension->EndpointListSpinLock, OldIrql);