mirror of git://git.sysmocom.de/ofono
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.
This commit is contained in:
parent
567e5ec9fc
commit
aaf70beb06
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue