~ubuntu-branches/ubuntu/utopic/libfprint/utopic

« back to all changes in this revision

Viewing changes to debian/patches/u8a87ba4-uru4000-fix-cancelling-of-imaging-from-error-callbac.patch

  • Committer: Package Import Robot
  • Author(s): Didier Raboud
  • Date: 2013-05-18 16:35:39 UTC
  • mfrom: (4.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20130518163539-qvwsan4edkdtry6f
Tags: 1:0.5.0-5
* Upload to unstable with two more backports from upstream:
  - imgdev: fix cancelling of enrollment from stage_completed callback
  - upeke2: Add support for 147e:2020 ID

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 8a87ba448c62eb14fa51d70ce870dd10b67ba76b Mon Sep 17 00:00:00 2001
 
2
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
 
3
Date: Mon, 3 Dec 2012 09:51:27 +0200
 
4
Subject: [PATCH] uru4000: fix cancelling of imaging from error callback
 
5
 
 
6
Call error callback before resetting img_transfer to NULL. This
 
7
variable is internally used to detect if we are still in imaging
 
8
loop and the call to execute_state_change() needs to be postponed.
 
9
Since this is the final thing imaging_complete() we can't reset
 
10
img_transfer until just before this call.
 
11
 
 
12
https://bugs.freedesktop.org/show_bug.cgi?id=57829
 
13
---
 
14
 libfprint/drivers/uru4000.c |    9 ++++++---
 
15
 1 file changed, 6 insertions(+), 3 deletions(-)
 
16
 
 
17
diff --git a/libfprint/drivers/uru4000.c b/libfprint/drivers/uru4000.c
 
18
index 07e26a4..ccaa87f 100644
 
19
--- a/libfprint/drivers/uru4000.c
 
20
+++ b/libfprint/drivers/uru4000.c
 
21
@@ -789,15 +789,18 @@ static void imaging_complete(struct fpi_ssm *ssm)
 
22
        int r = ssm->error;
 
23
        fpi_ssm_free(ssm);
 
24
 
 
25
+       /* Report error before exiting imaging loop - the error handler
 
26
+        * can request state change, which needs to be postponed to end of
 
27
+        * this function. */
 
28
+       if (r)
 
29
+               fpi_imgdev_session_error(dev, r);
 
30
+
 
31
        g_free(urudev->img_data);
 
32
        urudev->img_data = NULL;
 
33
 
 
34
        libusb_free_transfer(urudev->img_transfer);
 
35
        urudev->img_transfer = NULL;
 
36
 
 
37
-       if (r)
 
38
-               fpi_imgdev_session_error(dev, r);
 
39
-
 
40
        r = execute_state_change(dev);
 
41
        if (r)
 
42
                fpi_imgdev_session_error(dev, r);
 
43
-- 
 
44
1.7.10.4
 
45