lib: Make fp_get_pollfds() fail when fp_init() wasn't called
So things can't be called out-of-order.
This commit is contained in:
parent
36b696f433
commit
a54d020c97
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue