Skip to content

Commit

Permalink
Merge remote-tracking branch 'kraxel/usb.86' into staging
Browse files Browse the repository at this point in the history
# By Gerd Hoffmann
# Via Gerd Hoffmann
* kraxel/usb.86:
  usb-redir: fix use-after-free
  xhci: fix segfault

Message-id: 1375362669-14815-1-git-send-email-kraxel@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
  • Loading branch information
Anthony Liguori committed Aug 5, 2013
2 parents b9ac5d9 + a14ff8a commit d94c426
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions hw/usb/hcd-xhci.c
Expand Up @@ -1429,7 +1429,6 @@ static TRBCCode xhci_reset_ep(XHCIState *xhci, unsigned int slotid,
{
XHCISlot *slot;
XHCIEPContext *epctx;
USBDevice *dev;

trace_usb_xhci_ep_reset(slotid, epid);
assert(slotid >= 1 && slotid <= xhci->numslots);
Expand Down Expand Up @@ -1465,8 +1464,8 @@ static TRBCCode xhci_reset_ep(XHCIState *xhci, unsigned int slotid,
ep |= 0x80;
}

dev = xhci->slots[slotid-1].uport->dev;
if (!dev) {
if (!xhci->slots[slotid-1].uport ||
!xhci->slots[slotid-1].uport->dev) {
return CC_USB_TRANSACTION_ERROR;
}

Expand Down
1 change: 1 addition & 0 deletions hw/usb/redirect.c
Expand Up @@ -1334,6 +1334,7 @@ static void usbredir_handle_destroy(USBDevice *udev)
USBRedirDevice *dev = DO_UPCAST(USBRedirDevice, dev, udev);

qemu_chr_delete(dev->cs);
dev->cs = NULL;
/* Note must be done after qemu_chr_close, as that causes a close event */
qemu_bh_delete(dev->chardev_close_bh);

Expand Down

0 comments on commit d94c426

Please sign in to comment.