Commit 9608ab37 authored by Bastien Nocera's avatar Bastien Nocera
Browse files

Don't crash when no devices are present

parent 73561989
...@@ -464,10 +464,12 @@ static struct fp_driver *find_supporting_driver(libusb_device *udev, ...@@ -464,10 +464,12 @@ static struct fp_driver *find_supporting_driver(libusb_device *udev,
} }
} while ((elem = g_slist_next(elem))); } while ((elem = g_slist_next(elem)));
fp_dbg("selected driver %s supports USB device %04x:%04x", if (best_drv != NULL) {
best_drv->name, dsc.idVendor, dsc.idProduct); fp_dbg("selected driver %s supports USB device %04x:%04x",
*devtype = best_devtype; best_drv->name, dsc.idVendor, dsc.idProduct);
*usb_id = best_usb_id; *devtype = best_devtype;
*usb_id = best_usb_id;
}
return best_drv; return best_drv;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment