mirror of git://git.sysmocom.de/ofono
simfs: fix GLib-CRITICAL warning
During modem release, when there is no SIM card, a GLib-CRITICAL issue occurs during the free of the sim fs context.
This commit is contained in:
parent
a8bdb87c10
commit
4ff9cf9a27
30
src/simfs.c
30
src/simfs.c
|
@ -166,21 +166,23 @@ void sim_fs_context_free(struct ofono_sim_context *context)
|
||||||
int n = 0;
|
int n = 0;
|
||||||
struct sim_fs_op *op;
|
struct sim_fs_op *op;
|
||||||
|
|
||||||
while ((op = g_queue_peek_nth(fs->op_q, n)) != NULL) {
|
if (fs->op_q) {
|
||||||
if (op->context != context) {
|
while ((op = g_queue_peek_nth(fs->op_q, n)) != NULL) {
|
||||||
n += 1;
|
if (op->context != context) {
|
||||||
continue;
|
n += 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (n == 0) {
|
||||||
|
op->cb = NULL;
|
||||||
|
|
||||||
|
n += 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
sim_fs_op_free(op);
|
||||||
|
g_queue_remove(fs->op_q, op);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n == 0) {
|
|
||||||
op->cb = NULL;
|
|
||||||
|
|
||||||
n += 1;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
sim_fs_op_free(op);
|
|
||||||
g_queue_remove(fs->op_q, op);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (context->file_watches)
|
if (context->file_watches)
|
||||||
|
|
Loading…
Reference in New Issue