https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ed9f0dca14ea2e002868bad30e4f6b6e9dec7e0c

commit ed9f0dca14ea2e002868bad30e4f6b6e9dec7e0c
Author:     Serge Gautherie <[email protected]>
AuthorDate: Tue Sep 24 07:15:06 2019 +0200
Commit:     Victor Perevertkin <[email protected]>
CommitDate: Sun Sep 29 13:39:12 2019 +0300

    [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);

Reply via email to