fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30454 )
Change subject: mobile: clean up GAPK I/O state on channel release ......................................................................
mobile: clean up GAPK I/O state on channel release
Do not assert() in gsm_recv_voice(), because channel release does not happen immediately and the PHY may be still sending TCH frames.
Change-Id: I8943ee9bd46afc96e6d7cfd52c95c34fd311ce11 Related: OS#3400 --- M src/host/layer23/src/mobile/gsm48_rr.c M src/host/layer23/src/mobile/voice.c 2 files changed, 8 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/54/30454/1
diff --git a/src/host/layer23/src/mobile/gsm48_rr.c b/src/host/layer23/src/mobile/gsm48_rr.c index 610242c..4ecbcff 100644 --- a/src/host/layer23/src/mobile/gsm48_rr.c +++ b/src/host/layer23/src/mobile/gsm48_rr.c @@ -397,6 +397,10 @@ memset(&rr->cd_now, 0, sizeof(rr->cd_now)); /* reset ciphering */ rr->cipher_on = 0; +#ifdef WITH_GAPK_IO + /* clean-up GAPK state */ + gapk_io_clean_up_ms(rr->ms); +#endif /* reset audio mode */ /* tell cell selection process to return to idle mode * NOTE: this must be sent unbuffered, because it will diff --git a/src/host/layer23/src/mobile/voice.c b/src/host/layer23/src/mobile/voice.c index c3c6a6a..260e1d2 100644 --- a/src/host/layer23/src/mobile/voice.c +++ b/src/host/layer23/src/mobile/voice.c @@ -82,11 +82,11 @@ return gsm_forward_mncc(ms, msg); case AUDIO_IOH_GAPK: #ifdef WITH_GAPK_IO - /* Prevent null pointer dereference */ - OSMO_ASSERT(ms->gapk_io != NULL); - /* Enqueue a frame to the DL TCH buffer */ - gapk_io_enqueue_dl(ms->gapk_io, msg); + if (ms->gapk_io != NULL) + gapk_io_enqueue_dl(ms->gapk_io, msg); + else + msgb_free(msg); break; #endif case AUDIO_IOH_L1PHY: