aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-08-28 11:50:26 +0200
committerGerd Hoffmann <kraxel@redhat.com>2012-08-31 11:57:41 +0200
commit7ce86aa1aafaa65e7d3e572873bdf37bdb896f49 (patch)
treeffe4e32be2a547e837b83e70ac191d63c63bf362
parente983395d30d1d5bfa0ed3ae9c028c130f7c498cc (diff)
downloadqemu-arm-7ce86aa1aafaa65e7d3e572873bdf37bdb896f49.tar.gz
ehci: Fix NULL ptr deref when unplugging an USB dev with an iso stream active
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--hw/usb/hcd-ehci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index f43d690eb5..a3aea6debe 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);