aboutsummaryrefslogtreecommitdiffstats
path: root/main/libfprint/0001-imgdev-fix-enum-mismatch.patch
blob: 19bc7f69f665f68577a291166832e83231549296 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From 9f408bf51b7740e87c3d0b90e5adc5de3c37c052 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Tue, 7 Oct 2014 08:18:41 +0300
Subject: imgdev: fix enum mismatch for dev_change_state() call
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This bug has existed long time, but it was uncovered by commit
e215b0509448 which enabled multiple enrollment rounds.

In practice this broke (at least) URU4000 driver state machine
causing it to enter indefinite loop - due to the invalid state
change callback.

Patch originally posted at:
http://lists.freedesktop.org/archives/fprint/2014-June/000603.html

Test and verification results:
http://lists.freedesktop.org/archives/fprint/2014-June/000607.html

Signed-off-by: Timo Teräs <timo.teras@iki.fi>

diff --git a/libfprint/imgdev.c b/libfprint/imgdev.c
index f960ee3..3b5d3f3 100644
--- a/libfprint/imgdev.c
+++ b/libfprint/imgdev.c
@@ -159,7 +159,7 @@ void fpi_imgdev_report_finger_status(struct fp_img_dev *imgdev,
 		    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);
+			dev_change_state(imgdev, IMGDEV_STATE_AWAIT_FINGER_ON);
 		}
 		break;
 	case IMG_ACTION_VERIFY:
-- 
cgit v0.10.2