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

old-commit-hash: 83cd67ddb5
vw-mqb-aeb
Dean Lee 4 years ago committed by GitHub
parent 7fc6a76f04
commit 31adaa3906
  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