egismoc: Assert that current transfer is unset when setting it

We need to ensure that we are not overwriting the instance transfer, so
that we can be sure that we are only doing one transfer at time.

Also we need to ensure that the ssm unsetting it, is the owner of it.
This commit is contained in:
Marco Trevisan (Treviño)
2024-02-19 15:45:29 +01:00
parent b97efa6fed
commit 8badfa84e9

View File

@@ -263,6 +263,9 @@ egismoc_cmd_ssm_done (FpiSsm *ssm,
FpiDeviceEgisMoc *self = FPI_DEVICE_EGISMOC (device);
CommandData *data = fpi_ssm_get_data (ssm);
g_assert (self->cmd_ssm == ssm);
g_assert (!self->cmd_transfer || self->cmd_transfer->ssm == ssm);
self->cmd_ssm = NULL;
self->cmd_transfer = NULL;
@@ -373,6 +376,8 @@ egismoc_exec_cmd (FpDevice *device,
buffer_out_length,
g_free);
transfer->ssm = self->cmd_ssm;
g_assert (self->cmd_transfer == NULL);
self->cmd_transfer = g_steal_pointer (&transfer);
data->callback = callback;