Skip to content

Commit

Permalink
fix BSOD of vhci(ude) crash for single intf dev
Browse files Browse the repository at this point in the history
vhci(ude) suffered from crash when a single interface device was
attached. Fix that BSOD.
  • Loading branch information
cezanne committed Dec 27, 2020
1 parent cd44397 commit 4c7112f
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions driver/vhci_ude/vhci_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,8 @@ vusb_plugin(pctx_vhci_t vhci, pvhci_pluginfo_t pluginfo)
vusb = TO_VUSB(ude_usbdev);
vusb->vhci = vhci;

if (eptype == UdecxEndpointTypeSimple) {
vusb->is_simple_ep_alloc = TRUE;
create_endpoints(ude_usbdev, pluginfo);
}
else {
vusb->is_simple_ep_alloc = FALSE;
vusb->ep_default = NULL;
}
vusb->ep_default = NULL;
vusb->is_simple_ep_alloc = (eptype == UdecxEndpointTypeSimple) ? TRUE : FALSE;

UDECX_USB_DEVICE_PLUG_IN_OPTIONS_INIT(&opts);
opts.Usb20PortNumber = pluginfo->port;
Expand All @@ -279,6 +273,9 @@ vusb_plugin(pctx_vhci_t vhci, pvhci_pluginfo_t pluginfo)
return NULL;
}

if (vusb->is_simple_ep_alloc)
create_endpoints(ude_usbdev, pluginfo);

status = UdecxUsbDevicePlugIn(ude_usbdev, &opts);
if (NT_ERROR(status)) {
TRE(PLUGIN, "failed to plugin a new device %!STATUS!", status);
Expand Down

0 comments on commit 4c7112f

Please sign in to comment.