Commit a54d020c authored by Bastien Nocera's avatar Bastien Nocera
Browse files

lib: Make fp_get_pollfds() fail when fp_init() wasn't called

So things can't be called out-of-order.
parent 36b696f4
......@@ -418,6 +418,8 @@ API_EXPORTED ssize_t fp_get_pollfds(struct fp_pollfd **pollfds)
ssize_t cnt = 0;
size_t i = 0;
g_return_val_if_fail (fpi_usb_ctx != NULL, -EIO);
usbfds = libusb_get_pollfds(fpi_usb_ctx);
if (!usbfds) {
*pollfds = NULL;
Markdown is supported
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