From b3565b83e133bd9235e3189556b101b0ce68c41d Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Thu, 7 May 2020 19:04:33 +0200 Subject: [PATCH] upekts: Only release USB interface on exit The device is already beeing de-initialised from the verify/enroll commands. Trying it again will result in a timeout error as it is not responding properly at that point. --- libfprint/drivers/upekts.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/libfprint/drivers/upekts.c b/libfprint/drivers/upekts.c index 76d2298..4540231 100644 --- a/libfprint/drivers/upekts.c +++ b/libfprint/drivers/upekts.c @@ -856,21 +856,14 @@ dev_init (FpDevice *dev) fpi_ssm_start (ssm, initsm_done); } -static void -deinitsm_done (FpiSsm *ssm, FpDevice *dev, GError *error) -{ - g_usb_device_release_interface (fpi_device_get_usb_device (dev), 0, 0, NULL); - - fpi_device_close_complete (dev, error); -} - static void dev_exit (FpDevice *dev) { - FpiSsm *ssm; + GError *error = NULL; - ssm = fpi_ssm_new (dev, deinitsm_state_handler, DEINITSM_NUM_STATES); - fpi_ssm_start (ssm, deinitsm_done); + g_usb_device_release_interface (fpi_device_get_usb_device (dev), 0, 0, &error); + + fpi_device_close_complete (dev, error); } static const unsigned char enroll_init[] = {