lchan_release(): do not release UNUSED lchan

I noticed that lchan_release() is generally called in varying error
situations, so it makes sense to generally skip the release procedure
when the lchan is already in the UNUSED state.

Change-Id: I6e9faf682d1668388d5470419110408a098b9900
This commit is contained in:
Neels Hofmeyr 2021-04-25 16:35:02 +02:00
parent 730fc73bd2
commit e8bb7438cb
1 changed files with 1 additions and 1 deletions

View File

@ -1592,7 +1592,7 @@ void lchan_release(struct gsm_lchan *lchan, bool do_rr_release,
bool err, enum gsm48_rr_cause cause_rr,
const struct osmo_plmn_id *last_eutran_plmn)
{
if (!lchan || !lchan->fi)
if (!lchan || !lchan->fi || lchan->fi->state == LCHAN_ST_UNUSED)
return;
if (lchan->release.in_release_handler)