Skip to content

Commit

Permalink
dont fail assert in xhc-hb04 driver when device is disconnected
Browse files Browse the repository at this point in the history
Signed-off-by: Rene Hopf <renehopf@mac.com>
  • Loading branch information
rene-dev committed Aug 9, 2019
1 parent 4351917 commit 85a8f26
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/hal/user_comps/xhc-hb04.cc
Expand Up @@ -883,7 +883,8 @@ int main (int argc,char **argv)
libusb_cancel_transfer(transfer_in); // ignore result
assert (0 == libusb_handle_events_completed(ctx, nullptr));
libusb_free_transfer(transfer_in);
assert (0 == libusb_release_interface(dev_handle, 0));
r = libusb_release_interface(dev_handle, 0);
assert (r == 0 || r == LIBUSB_ERROR_NO_DEVICE);
libusb_close(dev_handle);
} else {
while (!do_exit) usleep(70000);
Expand Down

0 comments on commit 85a8f26

Please sign in to comment.