summaryrefslogtreecommitdiff
path: root/libfprint
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2012-12-03 09:51:27 +0200
committerBastien Nocera <hadess@hadess.net>2012-12-14 13:16:31 +0100
commit8a87ba448c62eb14fa51d70ce870dd10b67ba76b (patch)
tree8973c7c2d02e90a39a8819ac1e2485e7f49cbffc /libfprint
parent7e1646c382bbd6dc21a167bf7f0e45afa5ea217e (diff)
uru4000: fix cancelling of imaging from error callback
Call error callback before resetting img_transfer to NULL. This variable is internally used to detect if we are still in imaging loop and the call to execute_state_change() needs to be postponed. Since this is the final thing imaging_complete() we can't reset img_transfer until just before this call. https://bugs.freedesktop.org/show_bug.cgi?id=57829
Diffstat (limited to 'libfprint')
-rw-r--r--libfprint/drivers/uru4000.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libfprint/drivers/uru4000.c b/libfprint/drivers/uru4000.c
index 07e26a4..ccaa87f 100644
--- a/libfprint/drivers/uru4000.c
+++ b/libfprint/drivers/uru4000.c
@@ -789,15 +789,18 @@ static void imaging_complete(struct fpi_ssm *ssm)
int r = ssm->error;
fpi_ssm_free(ssm);
+ /* Report error before exiting imaging loop - the error handler
+ * can request state change, which needs to be postponed to end of
+ * this function. */
+ if (r)
+ fpi_imgdev_session_error(dev, r);
+
g_free(urudev->img_data);
urudev->img_data = NULL;
libusb_free_transfer(urudev->img_transfer);
urudev->img_transfer = NULL;
- if (r)
- fpi_imgdev_session_error(dev, r);
-
r = execute_state_change(dev);
if (r)
fpi_imgdev_session_error(dev, r);