    int err;
    int transferred = 0;
  
    pthread_mutex_lock(&usb_lock);
  
    do {
      err = libusb_bulk_transfer(dev_handle, endpoint, data, length, &transferred, timeout);
  
 
</s>
  if (!connected){
    return 0;
  }

    int err;
    int transferred = 0;
  
  if (!connected){
    return 0;
  }

    pthread_mutex_lock(&usb_lock);
  
    do {
      err = libusb_bulk_transfer(dev_handle, endpoint, data, length, &transferred, timeout);
  
keep keep add keep keep keep keep keep
 boardd: return early from usb functions if not connected
selfdrive/boardd/panda.cc