close usb handle after faile (#1352)

old-commit-hash: dd05d1df83
commatwo_master
Dean Lee 5 years ago committed by GitHub
parent ea0392cc2a
commit 7c22a08b30
  1. 5
      selfdrive/boardd/boardd.cc

@ -161,6 +161,11 @@ bool usb_connect() {
ignition_last = false; ignition_last = false;
if (dev_handle != NULL){
libusb_close(dev_handle);
dev_handle = NULL;
}
dev_handle = libusb_open_device_with_vid_pid(ctx, 0xbbaa, 0xddcc); dev_handle = libusb_open_device_with_vid_pid(ctx, 0xbbaa, 0xddcc);
if (dev_handle == NULL) { goto fail; } if (dev_handle == NULL) { goto fail; }

Loading…
Cancel
Save