QEMU update with VENOM (CVE-2015-3456) patch
[packages/centos6/qemu.git] / 0127-usb-core-Don-t-set-packet-state-to-complete-on-a-nak.patch
1 From bcd7c845fbfbafe03e320fbffcaa32417cfd5267 Mon Sep 17 00:00:00 2001
2 From: Hans de Goede <hdegoede@redhat.com>
3 Date: Mon, 3 Sep 2012 12:33:44 +0200
4 Subject: [PATCH] usb-core: Don't set packet state to complete on a nak
5
6 This way the hcd can re-use the same packet to retry without needing
7 to re-init it.
8
9 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
10 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 (cherry picked from commit cc40997489260f405aecccd30d4626ceee862502)
12
13 Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
14 ---
15  hw/usb/core.c | 6 ++++--
16  1 file changed, 4 insertions(+), 2 deletions(-)
17
18 diff --git a/hw/usb/core.c b/hw/usb/core.c
19 index 2da38e7..be6d936 100644
20 --- a/hw/usb/core.c
21 +++ b/hw/usb/core.c
22 @@ -399,8 +399,10 @@ int usb_handle_packet(USBDevice *dev, USBPacket *p)
23               * otherwise packets can complete out of order!
24               */
25              assert(!p->ep->pipeline);
26 -            p->result = ret;
27 -            usb_packet_set_state(p, USB_PACKET_COMPLETE);
28 +            if (ret != USB_RET_NAK) {
29 +                p->result = ret;
30 +                usb_packet_set_state(p, USB_PACKET_COMPLETE);
31 +            }
32          }
33      } else {
34          ret = USB_RET_ASYNC;
35 -- 
36 1.7.12.1
37