diff options
author | Slava Monich <slava.monich@jolla.com> | 2017-01-05 15:28:56 +0300 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2017-01-06 12:25:48 -0600 |
commit | aaf70beb0653fed6aeb87c91534431bdf75da955 (patch) | |
tree | c172f5a5213ea048d30fef48fa1e8fa2992be21c /src/sim.c | |
parent | 567e5ec9fca6990f22b2febc0ca54b74cfd3f1b1 (diff) | |
download | ofono-aaf70beb0653fed6aeb87c91534431bdf75da955.tar.gz |
sim: Stop facility lock query sequence on removal
SIM card can be removed while the query is in progress. There's
still a remote possibility that SIM card is removed and inserted
back while the query is pending, that would start the second query
sequence and end up invoking sim_initialize() twice. But at least
these checks reduce the probability of something like that happening.
Diffstat (limited to 'src/sim.c')
-rw-r--r-- | src/sim.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -2466,6 +2466,9 @@ static void sim_query_fac_pinlock_cb(const struct ofono_error *error, { struct ofono_sim *sim = data; + if (sim->state == OFONO_SIM_STATE_NOT_PRESENT) + return; + if (error->type != OFONO_ERROR_TYPE_NO_ERROR) goto done; @@ -2480,6 +2483,9 @@ static void sim_query_fac_networklock_cb(const struct ofono_error *error, { struct ofono_sim *sim = data; + if (sim->state == OFONO_SIM_STATE_NOT_PRESENT) + return; + if (error->type != OFONO_ERROR_TYPE_NO_ERROR) goto done; @@ -2496,6 +2502,9 @@ static void sim_query_fac_imsilock_cb(const struct ofono_error *error, { struct ofono_sim *sim = data; + if (sim->state == OFONO_SIM_STATE_NOT_PRESENT) + return; + if (error->type != OFONO_ERROR_TYPE_NO_ERROR) goto done; |