From 2373a4b65843847e3dacca958f0bab833032b796 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Fri, 5 May 2017 11:33:11 +0200 Subject: [PATCH] port-qmi: fix QMI client allocation procedure Commit 26ee94ec28b6f68 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 --- src/mm-port-qmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mm-port-qmi.c b/src/mm-port-qmi.c index 2baeea7c..5810e095 100644 --- a/src/mm-port-qmi.c +++ b/src/mm-port-qmi.c @@ -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);