From 90a1abf2f823ac1fd5915fc750ad2372832858dd Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Mon, 19 Oct 2020 16:59:28 +0200 Subject: [PATCH] synaptics: Fix missing reference to interrupt transfer When resubmitting the interrupt transfer we need to add a new reference as the submit function will steal it again. --- libfprint/drivers/synaptics/synaptics.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libfprint/drivers/synaptics/synaptics.c b/libfprint/drivers/synaptics/synaptics.c index d2ee0be..1632e5c 100644 --- a/libfprint/drivers/synaptics/synaptics.c +++ b/libfprint/drivers/synaptics/synaptics.c @@ -199,9 +199,17 @@ cmd_interrupt_cb (FpiUsbTransfer *transfer, } if (transfer->buffer[0] & USB_ASYNC_MESSAGE_PENDING) - fpi_ssm_next_state (transfer->ssm); + { + fpi_ssm_next_state (transfer->ssm); + } else - fpi_usb_transfer_submit (transfer, 1000, NULL, cmd_interrupt_cb, NULL); + { + fpi_usb_transfer_submit (fpi_usb_transfer_ref (transfer), + 1000, + NULL, + cmd_interrupt_cb, + NULL); + } } static void