diff options
author | Nicolas Norvez <norvez@chromium.org> | 2018-07-24 20:08:14 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-07-25 16:35:16 -0700 |
commit | 44412ba28a2474418f89ee749ca2db107eed703f (patch) | |
tree | fc69bb25396651c77355bf5af09da59fb1dd3e1c /common | |
parent | efac3d3266c6ddcca411d46e24f2d12a593d6670 (diff) | |
download | chrome-ec-44412ba28a2474418f89ee749ca2db107eed703f.tar.gz |
fpsensor: don't try to match without templates
If the host has reset the context and deleted the templates, don't let
it attempt to match again, that confuses the state of the EC:
[67.737556 Matching/0 ...]
[67.737565 Match =>-123371036 (finger -1)]
It then systematically fails to match, even after normal operations have
resumed.
Found while working on b:77568272
Signed-off-by: Nicolas Norvez <norvez@chromium.org>
BRANCH=None
BUG=b:77568272
TEST=Attempt match after context has been reset, no undefined variables
in the log, EC works as expected after biod has been restarted.
Change-Id: I09ddb71a1c0dabfeed5504053c40e28e41da392d
Reviewed-on: https://chromium-review.googlesource.com/1149516
Commit-Ready: Nicolas Norvez <norvez@chromium.org>
Tested-by: Nicolas Norvez <norvez@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/fpsensor.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/common/fpsensor.c b/common/fpsensor.c index f37fafa8c7..a8a1f00507 100644 --- a/common/fpsensor.c +++ b/common/fpsensor.c @@ -141,14 +141,15 @@ static uint32_t fp_process_enroll(void) static uint32_t fp_process_match(void) { - int res; + int res = -1; uint32_t updated = 0; int32_t fgr = -1; /* match finger against current templates */ CPRINTS("Matching/%d ...", templ_valid); - res = fp_finger_match(fp_template[0], templ_valid, fp_buffer, - &fgr, &updated); + if (templ_valid) + res = fp_finger_match(fp_template[0], templ_valid, fp_buffer, + &fgr, &updated); CPRINTS("Match =>%d (finger %d)", res, fgr); if (res < 0) res = EC_MKBP_FP_ERR_MATCH_NO_INTERNAL; |