XHCI fix xhci_delete_usb_device with a null check, usbdrv Implement usbdrv_fini
This commit is contained in:
@@ -207,6 +207,8 @@ DEFINE_DEVICE_INIT (usbdrv_init) {
|
||||
usbdrv->xhci = init->xhci;
|
||||
usbdrv->usb_device = init->usb_device;
|
||||
|
||||
device->udata = usbdrv;
|
||||
|
||||
usbdrv_setup_endpoints (usbdrv);
|
||||
|
||||
ret =
|
||||
@@ -236,4 +238,8 @@ DEFINE_DEVICE_INIT (usbdrv_init) {
|
||||
return true;
|
||||
}
|
||||
|
||||
DEFINE_DEVICE_FINI (usbdrv_fini) {}
|
||||
DEFINE_DEVICE_FINI (usbdrv_fini) {
|
||||
struct usbdrv* usbdrv = device->udata;
|
||||
|
||||
free (usbdrv);
|
||||
}
|
||||
|
||||
@@ -69,6 +69,7 @@ static void xhci_delete_usb_device (struct xhci* xhci, struct xhci_port* xhci_po
|
||||
list_find (struct xhci_usb_device, xhci->xhci_usb_devices, usb_device, xhci_port->port_value,
|
||||
xhci_port->port_value, usb_devices_link);
|
||||
|
||||
if (usb_device != NULL) {
|
||||
device_delete (usb_device->device->key, proc, rctx);
|
||||
|
||||
list_remove (xhci->xhci_usb_devices, &usb_device->usb_devices_link);
|
||||
@@ -81,6 +82,7 @@ static void xhci_delete_usb_device (struct xhci* xhci, struct xhci_port* xhci_po
|
||||
|
||||
free (usb_device);
|
||||
}
|
||||
}
|
||||
|
||||
static void xhci_bios_handover (struct xhci* xhci) {
|
||||
uint32_t hccparams1 = xhci_read32 (xhci->xhci_mmio_base, XHCI_HCCPARAMS1);
|
||||
|
||||
Reference in New Issue
Block a user