pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/32357 )
Change subject: ms: Make sure tbf!=NULL in ms_attach_{ul,dl}_tbf() ......................................................................
ms: Make sure tbf!=NULL in ms_attach_{ul,dl}_tbf()
It makes no sense to pass "NULL" to attach function. There's a detach function to be used if a given TBF has to be detached.
Change-Id: I0c5df195c080b21e5516aebfb46db22bdc55f2a2 --- M src/gprs_ms.c 1 file changed, 17 insertions(+), 4 deletions(-)
Approvals: Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, approved
diff --git a/src/gprs_ms.c b/src/gprs_ms.c index f65ffb8..357470b 100644 --- a/src/gprs_ms.c +++ b/src/gprs_ms.c @@ -362,8 +362,7 @@
ms->ul_tbf = tbf;
- if (tbf) - ms_release_timer_stop(ms); + ms_release_timer_stop(ms);
ms_unref(ms, __func__); } @@ -382,14 +381,16 @@
ms->dl_tbf = tbf;
- if (tbf) - ms_release_timer_stop(ms); + ms_release_timer_stop(ms);
ms_unref(ms, __func__); }
void ms_attach_tbf(struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf) { + OSMO_ASSERT(ms); + OSMO_ASSERT(tbf); + if (tbf_direction(tbf) == GPRS_RLCMAC_DL_TBF) ms_attach_dl_tbf(ms, tbf_as_dl_tbf(tbf)); else