From 46ebb39f6511b65f278e82f02fb52608356d9cf7 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 11 Oct 2018 14:58:04 +0200 Subject: [PATCH] lib: Throw an error if fp_init() wasn't called You can't call fp_discover_devs() without calling fp_init() and having it not fail, otherwise there's nothing to discover... --- libfprint/fpi-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libfprint/fpi-core.c b/libfprint/fpi-core.c index 8009fe1..46e664b 100644 --- a/libfprint/fpi-core.c +++ b/libfprint/fpi-core.c @@ -259,8 +259,7 @@ API_EXPORTED struct fp_dscv_dev **fp_discover_devs(void) int r; int i = 0; - if (registered_drivers == NULL) - return NULL; + g_return_val_if_fail (registered_drivers != NULL, NULL); r = libusb_get_device_list(fpi_usb_ctx, &devs); if (r < 0) {