diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2017-05-22 13:18:19 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2017-05-23 18:41:36 +0200 |
commit | 8387dc7a7c6b21b28783c7db6d94a111ce7b7485 (patch) | |
tree | 160cbef22a04290ec6be0dc7891db2accf3b93bc /src | |
parent | 0f99328af635979a91c4c4e31e2d6692d2b78181 (diff) |
broadband-modem: don't create sim hot swap ports context multiple times
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-broadband-modem.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c index 4a14d33d..68242e5c 100644 --- a/src/mm-broadband-modem.c +++ b/src/mm-broadband-modem.c @@ -10154,7 +10154,9 @@ initialize_step (InitializeContext *ctx) return; case INITIALIZE_STEP_SIM_HOT_SWAP: - { + /* Create the SIM hot swap ports context only if not already done before + * (we may be re-running the initialization step after SIM-PIN unlock) */ + if (!ctx->self->priv->sim_hot_swap_ports_ctx) { gboolean is_sim_hot_swap_supported = FALSE; g_object_get (ctx->self, @@ -10165,7 +10167,7 @@ initialize_step (InitializeContext *ctx) PortsContext *ports; GError *error = NULL; - mm_dbg ("Creating PortsContext for SIM hot swap."); + mm_dbg ("Creating ports context for SIM hot swap"); ports = g_new0 (PortsContext, 1); ports->ref_count = 1; @@ -10178,7 +10180,9 @@ initialize_step (InitializeContext *ctx) ports_context_unref (ports); } - } + } else + mm_dbg ("Ports context for SIM hot swap already available"); + /* Fall down to next step */ ctx->step++; |