Patchwork [for-1.2,04/11] ehci: Fix NULL ptr deref when unplugging an USB dev with an iso stream active

login
register
mail settings
Submitter Gerd Hoffmann
Date Aug. 31, 2012, 2:19 p.m.
Message ID <1346422762-15877-5-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/180978/
State New
Headers show

Comments

Gerd Hoffmann - Aug. 31, 2012, 2:19 p.m.
From: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 hw/usb/hcd-ehci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index f43d690..a3aea6d 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);