aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Chan <benchan@chromium.org>2013-09-13 23:14:45 -0700
committerAleksander Morgado <aleksander@lanedo.com>2013-09-16 07:51:53 +0200
commit5d8efff2910d448a0df220d8e38efc72875aa730 (patch)
tree026650123086d3476f41800ba973c6f6aa77e5cf
parent8a857b7b264204fd193fb83ad783d4316246a9b0 (diff)
iface-modem: free GError when interface initialization is cancelled
This patch fixes an assertion failure 'ctx->fatal_error == NULL' in initialization_context_complete_and_free(), which happens if 'fatal_error' of the initialization context is set during the modem interface initialization and the initialization is later cancelled.
-rw-r--r--src/mm-iface-modem.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c
index c5990509..748a7206 100644
--- a/src/mm-iface-modem.c
+++ b/src/mm-iface-modem.c
@@ -3530,6 +3530,12 @@ initialization_context_complete_and_free_if_cancelled (InitializationContext *ct
if (!g_cancellable_is_cancelled (ctx->cancellable))
return FALSE;
+ /* Simply ignore any fatal error encountered as the initialization is cancelled anyway. */
+ if (ctx->fatal_error) {
+ g_error_free (ctx->fatal_error);
+ ctx->fatal_error = NULL;
+ }
+
g_simple_async_result_set_error (ctx->result,
MM_CORE_ERROR,
MM_CORE_ERROR_CANCELLED,