panda: fix dev_list may be freed twice on failure (#22161)

pull/22168/head
Dean Lee 4 years ago committed by GitHub
parent 1c750975fc
commit 83cd67ddb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      selfdrive/boardd/panda.cc

@ -59,6 +59,7 @@ Panda::Panda(std::string serial) {
}
if (dev_handle == NULL) goto fail;
libusb_free_device_list(dev_list, 1);
dev_list = nullptr;
if (libusb_kernel_driver_active(dev_handle, 0) == 1) {
libusb_detach_kernel_driver(dev_handle, 0);

Loading…
Cancel
Save