提交 7cb513aa 编写于 作者: L Liam Merwick 提交者: Gerd Hoffmann

xhci: check device is not NULL before calling usb_ep_get()

Signed-off-by: NLiam Merwick <liam.merwick@oracle.com>
Message-id: 1549460216-25808-4-git-send-email-liam.merwick@oracle.com
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
上级 92cf3427
......@@ -3276,10 +3276,10 @@ static USBEndpoint *xhci_epid_to_usbep(XHCIEPContext *epctx)
return NULL;
}
uport = epctx->xhci->slots[epctx->slotid - 1].uport;
token = (epctx->epid & 1) ? USB_TOKEN_IN : USB_TOKEN_OUT;
if (!uport) {
if (!uport || !uport->dev) {
return NULL;
}
token = (epctx->epid & 1) ? USB_TOKEN_IN : USB_TOKEN_OUT;
return usb_ep_get(uport->dev, token, epctx->epid >> 1);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册