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
This commit is contained in:
parent
7751fcb375
commit
0b2d33c712
1 changed files with 4 additions and 1 deletions
|
@ -145,7 +145,10 @@ void fpi_imgdev_report_finger_status(struct fp_img_dev *imgdev,
|
|||
case IMG_ACTION_ENROLL:
|
||||
fp_dbg("reporting enroll result");
|
||||
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_state = IMG_ACQUIRE_STATE_AWAIT_FINGER_ON;
|
||||
dev_change_state(imgdev, IMG_ACQUIRE_STATE_AWAIT_FINGER_ON);
|
||||
|
|
Loading…
Reference in a new issue