port-qmi: fix QMI client allocation procedure
Commit 26ee94ec28 introduced a bug, where we would be completing
the client allocation task *before* tracking the new client allocation
info in the private tracking list.
This meant that if mm_port_qmi_peek_client() was called in the task
completion handler, the client object wouldn't be returned, as it
wasn't found in the private tracking list.
The fix is just to defer the task completion until after the private
tracking list is updated.
Reported-by: Salvador Penalva <salvador.penalva@digi.com>
This commit is contained in:
+1
-1
@@ -112,10 +112,10 @@ allocate_client_ready (QmiDevice *qmi_device,
|
||||
qmi_service_get_string (ctx->info->service));
|
||||
g_task_return_error (task, error);
|
||||
} else {
|
||||
g_task_return_boolean (task, TRUE);
|
||||
/* Move the service info to our internal list */
|
||||
self->priv->services = g_list_prepend (self->priv->services, ctx->info);
|
||||
ctx->info = NULL;
|
||||
g_task_return_boolean (task, TRUE);
|
||||
}
|
||||
|
||||
g_object_unref (task);
|
||||
|
||||
Reference in New Issue
Block a user