From: Hans de Goede Date: Tue, 28 Aug 2012 09:50:26 +0000 (+0200) Subject: ehci: Fix NULL ptr deref when unplugging an USB dev with an iso stream active X-Git-Tag: qemu-xen-4.3.0-rc1~636^2~7 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=7ce86aa1aafaa65e7d3e572873bdf37bdb896f49;p=qemu-upstream-4.4-testing.git ehci: Fix NULL ptr deref when unplugging an USB dev with an iso stream active Signed-off-by: Hans de Goede --- diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index f43d690eb..a3aea6deb 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -1598,7 +1598,7 @@ static int ehci_process_itd(EHCIState *ehci, dev = ehci_find_device(ehci, devaddr); ep = usb_ep_get(dev, pid, endp); - if (ep->type == USB_ENDPOINT_XFER_ISOC) { + if (ep && ep->type == USB_ENDPOINT_XFER_ISOC) { usb_packet_setup(&ehci->ipacket, pid, ep, addr); usb_packet_map(&ehci->ipacket, &ehci->isgl); ret = usb_handle_packet(dev, &ehci->ipacket);