From 629860c9655463ff794e4a6da73165bb80ebaa98 Mon Sep 17 00:00:00 2001 From: Ge-org Brohammer Date: Fri, 28 Aug 2026 13:28:34 +0200 Subject: [PATCH] realtek: Report duplicate enrollment as DATA_DUPLICATE When the sensor rejects an enrollment because the finger is already present in on-chip storage, fp_check_duplicate_cb() raises FP_DEVICE_ERROR_PROTO. That error class means "protocol error with the device", which is not what happened; the device answered correctly. The practical effect is that fprintd cannot classify the failure. It already maps FP_DEVICE_ERROR_DATA_DUPLICATE to its "enroll-duplicate" result, so with PROTO the user is shown "enroll-unknown-error" instead of being told to try a different finger. Use FP_DEVICE_ERROR_DATA_DUPLICATE, which exists for exactly this case. Reproduced on a Realtek 2541:fa03 (Minisforum AI X1 Pro) by enrolling the same finger twice: [realtek] SSM Enroll failed in state 5 with error: Current fingerprint is duplicate! Device reported enroll completion (print: (nil), error: [FP_DEVICE_ERROR_PROTO] Current fingerprint is duplicate!) fprintd: enroll_cb: result enroll-unknown-error --- libfprint/drivers/realtek/realtek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libfprint/drivers/realtek/realtek.c b/libfprint/drivers/realtek/realtek.c index 2c5ce06d..a41b0bad 100644 --- a/libfprint/drivers/realtek/realtek.c +++ b/libfprint/drivers/realtek/realtek.c @@ -516,7 +516,7 @@ fp_check_duplicate_cb (FpiDeviceRealtek *self, if (in_status == FP_RTK_SUCCESS) { fpi_ssm_mark_failed (self->task_ssm, - fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO, + fpi_device_error_new_msg (FP_DEVICE_ERROR_DATA_DUPLICATE, "Current fingerprint is duplicate!")); } else if (in_status == FP_RTK_MATCH_FAIL)