aboutsummaryrefslogtreecommitdiff
path: root/hw/usb/core.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-12-14 14:35:39 +0100
committerGerd Hoffmann <kraxel@redhat.com>2013-01-07 12:57:24 +0100
commit6735d433729f80fab80c0a1f70ae131398645613 (patch)
treea7eb1697af39a64b77eab7c272240a695cda14e2 /hw/usb/core.c
parent027c03f7327faa696e1d876954a18b5214c18583 (diff)
usb: Fix usb_ep_find_packet_by_id
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 <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/core.c')
-rw-r--r--hw/usb/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/usb/core.c b/hw/usb/core.c
index e315fc1021..d057aab900 100644
--- a/hw/usb/core.c
+++ b/hw/usb/core.c
@@ -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;
}