Also, pass in usbdev to usb_free_pipe().
Signed-off-by: Kevin O'Connor kevin@koconnor.net --- src/hw/usb-msc.c | 4 ++-- src/hw/usb-uas.c | 8 ++++---- src/hw/usb.c | 8 ++++---- src/hw/usb.h | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/hw/usb-msc.c b/src/hw/usb-msc.c index 388cbe5..d90319f 100644 --- a/src/hw/usb-msc.c +++ b/src/hw/usb-msc.c @@ -214,7 +214,7 @@ usb_msc_setup(struct usbdevice_s *usbdev) return 0; fail: dprintf(1, "Unable to configure USB MSC device.\n"); - free_pipe(inpipe); - free_pipe(outpipe); + usb_free_pipe(usbdev, inpipe); + usb_free_pipe(usbdev, outpipe); return -1; } diff --git a/src/hw/usb-uas.c b/src/hw/usb-uas.c index 9474383..6ef8d09 100644 --- a/src/hw/usb-uas.c +++ b/src/hw/usb-uas.c @@ -266,9 +266,9 @@ usb_uas_setup(struct usbdevice_s *usbdev) return 0;
fail: - free_pipe(command); - free_pipe(status); - free_pipe(data_in); - free_pipe(data_out); + usb_free_pipe(usbdev, command); + usb_free_pipe(usbdev, status); + usb_free_pipe(usbdev, data_in); + usb_free_pipe(usbdev, data_out); return -1; } diff --git a/src/hw/usb.c b/src/hw/usb.c index dfd2c89..c7cb674 100644 --- a/src/hw/usb.c +++ b/src/hw/usb.c @@ -53,7 +53,7 @@ usb_update_pipe(struct usbdevice_s *usbdev, struct usb_pipe *pipe case USB_TYPE_XHCI: return xhci_update_pipe(usbdev, pipe, epdesc); default: - free_pipe(pipe); + usb_free_pipe(usbdev, pipe); return usb_alloc_pipe(usbdev, epdesc); } } @@ -134,7 +134,7 @@ usb_send_default_control(struct usb_pipe *pipe, const struct usb_ctrlrequest *re
// Free an allocated control or bulk pipe. void -free_pipe(struct usb_pipe *pipe) +usb_free_pipe(struct usbdevice_s *usbdev, struct usb_pipe *pipe) { ASSERT32FLAT(); if (!pipe) @@ -312,7 +312,7 @@ usb_set_address(struct usbdevice_s *usbdev) req.wLength = 0; int ret = usb_send_default_control(usbdev->defpipe, &req, NULL); if (ret) { - free_pipe(usbdev->defpipe); + usb_free_pipe(usbdev, usbdev->defpipe); return -1; }
@@ -436,7 +436,7 @@ usb_hub_port_setup(void *data)
// Configure the device int count = configure_usb_device(usbdev); - free_pipe(usbdev->defpipe); + usb_free_pipe(usbdev, usbdev->defpipe); if (!count) hub->op->disconnect(hub, port); hub->devcount += count; diff --git a/src/hw/usb.h b/src/hw/usb.h index bcbad77..e6948de 100644 --- a/src/hw/usb.h +++ b/src/hw/usb.h @@ -235,7 +235,7 @@ int usb_poll_intr(struct usb_pipe *pipe, void *data); int usb_32bit_pipe(struct usb_pipe *pipe_fl); int usb_send_default_control(struct usb_pipe *pipe , const struct usb_ctrlrequest *req, void *data); -void free_pipe(struct usb_pipe *pipe); +void usb_free_pipe(struct usbdevice_s *usbdev, struct usb_pipe *pipe); struct usb_pipe *usb_getFreePipe(struct usb_s *cntl, u8 eptype); void usb_desc2pipe(struct usb_pipe *pipe, struct usbdevice_s *usbdev , struct usb_endpoint_descriptor *epdesc);