From: Benjamin Berg Date: Fri, 23 Oct 2020 18:42:55 +0200 Subject: vfs301: Fix device pointer handling in callback When porting the driver to the new libfprint 1.90.0 a mistake was made where the device was not passed through user_data anymore but it was still read from there. Stop using user_data in the callback to fix this. See: #320 Origin: https://gitlab.freedesktop.org/libfprint/libfprint/-/commit/d3076039d Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libfprint/+bug/1905597 --- libfprint/drivers/vfs301_proto.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libfprint/drivers/vfs301_proto.c b/libfprint/drivers/vfs301_proto.c index bcd09e9..8270780 100644 --- a/libfprint/drivers/vfs301_proto.c +++ b/libfprint/drivers/vfs301_proto.c @@ -508,30 +508,30 @@ vfs301_proto_process_event_cb (FpiUsbTransfer *transfer, FpDevice *device, gpointer user_data, GError *error) { - FpDeviceVfs301 *dev = user_data; + FpDeviceVfs301 *self = FPI_DEVICE_VFS301 (device); if (error) { g_warning ("Error receiving data: %s", error->message); g_error_free (error); - dev->recv_progress = VFS301_FAILURE; + self->recv_progress = VFS301_FAILURE; return; } else if (transfer->actual_length < transfer->length) { /* TODO: process the data anyway? */ - dev->recv_progress = VFS301_ENDED; + self->recv_progress = VFS301_ENDED; return; } else { FpiUsbTransfer *new; - if (!vfs301_proto_process_data (dev, + if (!vfs301_proto_process_data (self, transfer->length == VFS301_FP_RECV_LEN_1, transfer->buffer, transfer->actual_length)) { - dev->recv_progress = VFS301_ENDED; + self->recv_progress = VFS301_ENDED; return; }