Skip to content

Commit

Permalink
[sim-auth] Only close open sessions
Browse files Browse the repository at this point in the history
Session has to be open in order to have a valid session_id
  • Loading branch information
monich committed Apr 25, 2021
1 parent deefa2c commit 9d220ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ofono/src/sim.c
Expand Up @@ -3784,7 +3784,8 @@ void __ofono_sim_remove_session_watch(struct ofono_sim_aid_session *session,
{
__ofono_watchlist_remove_item(session->watches, id);

if (g_slist_length(session->watches->items) == 0) {
if (g_slist_length(session->watches->items) == 0 &&
session->state == SESSION_STATE_OPEN) {
/* last watcher, close session */
session->state = SESSION_STATE_CLOSING;
session->sim->driver->close_channel(session->sim,
Expand Down

0 comments on commit 9d220ff

Please sign in to comment.