mafpmoc: Clear errors when they are not forwarded

This commit is contained in:
Marco Trevisan (Treviño)
2026-06-18 15:47:34 +02:00
parent 67649a0efd
commit 8d81299743
+32 -9
View File
@@ -250,12 +250,13 @@ fp_cmd_receive_cb (FpiUsbTransfer *transfer,
if (error)
{
fp_dbg ("error: %d", error->code);
fp_dbg ("error: %d, %s", error->code, error->message);
if (data->cmd_force_pass) /* ex: G_USB_DEVICE_ERROR_TIMED_OUT */
{
if (data->callback)
data->callback (self, &cmd_reponse, NULL);
fpi_ssm_mark_completed (transfer->ssm);
g_clear_error (&error);
return;
}
fpi_ssm_mark_failed (transfer->ssm, error);
@@ -584,7 +585,10 @@ fp_init_module_status_cb (FpiDeviceMafpmoc *self,
GError *error)
{
if (error)
resp->result = 0xff;
{
resp->result = 0xff;
g_clear_error (&error);
}
fp_dbg ("result: %d", resp->result);
@@ -1173,9 +1177,13 @@ fp_enroll_wait_int_cb (FpiUsbTransfer *transfer,
{
fp_dbg ("code %d", error->code);
if (error->code == G_USB_DEVICE_ERROR_TIMED_OUT)
fpi_ssm_jump_to_state (self->task_ssm, FP_ENROLL_VERIFY_GET_IMAGE);
else
fpi_ssm_mark_failed (self->task_ssm, error);
{
fpi_ssm_jump_to_state (self->task_ssm, FP_ENROLL_VERIFY_GET_IMAGE);
g_clear_error (&error);
return;
}
fpi_ssm_mark_failed (self->task_ssm, g_steal_pointer (&error));
return;
}
fp_dbg ("actual_length %zd", transfer->actual_length);
@@ -1210,7 +1218,16 @@ fp_empty_cb (FpiDeviceMafpmoc *self,
mafp_cmd_response_t *resp,
GError *error)
{
fp_dbg ("result: %d", resp ? resp->result : -1);
if (error)
{
fp_dbg ("error: %s", error->message);
g_clear_error (&error);
}
else
{
fp_dbg ("result: %d", resp ? resp->result : -1);
}
fpi_ssm_next_state (self->task_ssm);
}
@@ -1566,7 +1583,9 @@ mafp_get_startup_result_cb (FpiUsbTransfer *transfer,
if (error)
{
fp_dbg ("error: %s", error->message);
fpi_ssm_next_state (transfer->ssm);
g_clear_error (&error);
return;
}
if (transfer->actual_length >= 5)
@@ -1664,9 +1683,13 @@ fp_verify_wait_int_cb (FpiUsbTransfer *transfer,
{
fp_dbg ("code %d", error->code);
if (error->code == G_USB_DEVICE_ERROR_TIMED_OUT)
fpi_ssm_jump_to_state (self->task_ssm, FP_VERIFY_GET_IMAGE);
else
fpi_ssm_mark_failed (self->task_ssm, error);
{
fpi_ssm_jump_to_state (self->task_ssm, FP_VERIFY_GET_IMAGE);
g_clear_error (&error);
return;
}
fpi_ssm_mark_failed (self->task_ssm, g_steal_pointer (&error));
return;
}
fp_dbg ("actual_length %zd", transfer->actual_length);