usbi_info (ITRANSFER_CTX (itransfer), "WARNING: aborting all transactions control pipe");
+ if (!dpriv->device)
+ return LIBUSB_ERROR_NO_DEVICE;
+
kresult = (*(dpriv->device))->USBDeviceAbortPipeZero (dpriv->device);
return darwin_to_libusb (kresult);
static int darwin_abort_transfers (struct usbi_transfer *itransfer) {
struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
+ struct darwin_device_priv *dpriv = (struct darwin_device_priv *)transfer->dev_handle->dev->os_priv;
struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv;
struct darwin_interface *cInterface;
uint8_t pipeRef, iface;
cInterface = &priv->interfaces[iface];
+ if (!dpriv->device)
+ return LIBUSB_ERROR_NO_DEVICE;
+
usbi_info (ITRANSFER_CTX (itransfer), "WARNING: aborting all transactions on interface %d pipe %d", iface, pipeRef);
/* abort transactions */