]> Git Repo - qemu.git/commitdiff
usb: Fix usb_ep_find_packet_by_id
authorHans de Goede <[email protected]>
Fri, 14 Dec 2012 13:35:39 +0000 (14:35 +0100)
committerGerd Hoffmann <[email protected]>
Mon, 7 Jan 2013 11:57:24 +0000 (12:57 +0100)
usb_ep_find_packet_by_id mistakenly only checks the first packet and if that
is not a match, keeps trying the first packet! This patch fixes this.

Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
hw/usb/core.c

index e315fc1021b90e91980c3a9e1579a7f4c6789478..d057aab90000eb87dae2995e2156337ce0631fbf 100644 (file)
@@ -761,7 +761,7 @@ USBPacket *usb_ep_find_packet_by_id(USBDevice *dev, int pid, int ep,
     struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
     USBPacket *p;
 
-    while ((p = QTAILQ_FIRST(&uep->queue)) != NULL) {
+    QTAILQ_FOREACH(p, &uep->queue, queue) {
         if (p->id == id) {
             return p;
         }
This page took 0.022849 seconds and 4 git commands to generate.