Commit 8a87ba44 authored by Timo Teräs's avatar Timo Teräs Committed by Bastien Nocera

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.
parent 7e1646c3
...@@ -789,15 +789,18 @@ static void imaging_complete(struct fpi_ssm *ssm) ...@@ -789,15 +789,18 @@ static void imaging_complete(struct fpi_ssm *ssm)
int r = ssm->error; int r = ssm->error;
fpi_ssm_free(ssm); 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); g_free(urudev->img_data);
urudev->img_data = NULL; urudev->img_data = NULL;
libusb_free_transfer(urudev->img_transfer); libusb_free_transfer(urudev->img_transfer);
urudev->img_transfer = NULL; urudev->img_transfer = NULL;
if (r)
fpi_imgdev_session_error(dev, r);
r = execute_state_change(dev); r = execute_state_change(dev);
if (r) if (r)
fpi_imgdev_session_error(dev, r); fpi_imgdev_session_error(dev, r);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment