From 9e7bfa05b3390d249df1095bfb9a054e658da1c3 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Thu, 8 Jul 2021 14:07:25 +0200 Subject: [PATCH] synaptics: Immediately succeed for empty identify Such an empty identify can be run by fprintd intentionally for duplicate checking at the start of an enroll operation, which currently runs into an error from the driver. Avoid this by simply returning success immediately. This is fine, as synaptics is only checking the explicitly passed list of prints rather than using all available prints from the storage. --- libfprint/drivers/synaptics/synaptics.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libfprint/drivers/synaptics/synaptics.c b/libfprint/drivers/synaptics/synaptics.c index 1680f48..d92135f 100644 --- a/libfprint/drivers/synaptics/synaptics.c +++ b/libfprint/drivers/synaptics/synaptics.c @@ -717,6 +717,21 @@ identify_msg_cb (FpiDeviceSynaptics *self, static void identify (FpDevice *device) { + GPtrArray *prints = NULL; + + fpi_device_get_identify_data (device, &prints); + + /* Identify over no prints does not work for synaptics. + * This *may* make sense for other devices though, as identify may return + * a matched print even if it is not in the list of prints. + */ + if (prints->len == 0) + { + fpi_device_identify_report (device, NULL, NULL, NULL); + fpi_device_identify_complete (device, NULL); + return; + } + init_identify_msg (device); compose_and_send_identify_msg (device); }