From b8dc77b56e89194a185a4d3db1e830459e551c5d Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Mon, 18 Feb 2008 17:50:48 +0000 Subject: [PATCH] Fix verify/identify error handling If verify_start failed, we need to run verify_stop. Same for identification. --- libfprint/drv.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libfprint/drv.c b/libfprint/drv.c index f1cc6c5..3055e99 100644 --- a/libfprint/drv.c +++ b/libfprint/drv.c @@ -17,6 +17,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#define FP_COMPONENT "drv" + #include #include "fp_internal.h" @@ -185,7 +187,8 @@ int fpi_drv_verify_stop(struct fp_dev *dev) gboolean iterating = (dev->state == DEV_STATE_VERIFYING); fp_dbg(""); - BUG_ON(dev->state != DEV_STATE_VERIFYING + BUG_ON(dev->state != DEV_STATE_ERROR + && dev->state != DEV_STATE_VERIFYING && dev->state != DEV_STATE_VERIFY_DONE); dev->verify_cb = NULL; @@ -243,7 +246,8 @@ void fpi_drvcb_report_identify_result(struct fp_dev *dev, int result, size_t match_offset, struct fp_img *img) { fp_dbg("result %d", result); - BUG_ON(dev->state != DEV_STATE_IDENTIFYING); + BUG_ON(dev->state != DEV_STATE_IDENTIFYING + && dev->state != DEV_STATE_ERROR); if (result < 0 || result == FP_VERIFY_NO_MATCH || result == FP_VERIFY_MATCH) { dev->state = DEV_STATE_IDENTIFY_DONE;