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
This commit is contained in:
Ge-org Brohammer
2026-08-31 17:46:55 +00:00
parent 3f1e2817ed
commit 629860c965
+1 -1
View File
@@ -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)