Commit 0b2d33c7 authored by Timo Teräs's avatar Timo Teräs Committed by Bastien Nocera

imgdev: fix cancelling of enrollment from stage_completed callback

Re-check device state after fpi_drvcb_enroll_stage_completed().
If enrollment was cancelled after non-completing stage, we must
not restart acquire as it would confuse the internal state machine.

https://bugs.freedesktop.org/show_bug.cgi?id=57829
parent 7751fcb3
...@@ -145,7 +145,10 @@ void fpi_imgdev_report_finger_status(struct fp_img_dev *imgdev, ...@@ -145,7 +145,10 @@ void fpi_imgdev_report_finger_status(struct fp_img_dev *imgdev,
case IMG_ACTION_ENROLL: case IMG_ACTION_ENROLL:
fp_dbg("reporting enroll result"); fp_dbg("reporting enroll result");
fpi_drvcb_enroll_stage_completed(imgdev->dev, r, data, img); fpi_drvcb_enroll_stage_completed(imgdev->dev, r, data, img);
if (r > 0 && r != FP_ENROLL_COMPLETE && r != FP_ENROLL_FAIL) { /* the callback can cancel enrollment, so recheck current
* action and the status to see if retry is needed */
if (imgdev->action == IMG_ACTION_ENROLL &&
r > 0 && r != FP_ENROLL_COMPLETE && r != FP_ENROLL_FAIL) {
imgdev->action_result = 0; imgdev->action_result = 0;
imgdev->action_state = IMG_ACQUIRE_STATE_AWAIT_FINGER_ON; imgdev->action_state = IMG_ACQUIRE_STATE_AWAIT_FINGER_ON;
dev_change_state(imgdev, IMG_ACQUIRE_STATE_AWAIT_FINGER_ON); dev_change_state(imgdev, IMG_ACQUIRE_STATE_AWAIT_FINGER_ON);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment