aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/phy_link.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/common/phy_link.c b/src/common/phy_link.c
index 5ad72ac7..352d8f72 100644
--- a/src/common/phy_link.c
+++ b/src/common/phy_link.c
@@ -129,10 +129,12 @@ void phy_instance_destroy(struct phy_instance *pinst)
/* remove from list of instances in the link */
llist_del(&pinst->list);
- /* remove reverse link from TRX */
- OSMO_ASSERT(pinst->trx->pinst == pinst);
- pinst->trx->pinst = NULL;
- pinst->trx = NULL;
+ /* remove reverse link from TRX (if associated) */
+ if (pinst->trx != NULL) {
+ OSMO_ASSERT(pinst->trx->pinst == pinst);
+ pinst->trx->pinst = NULL;
+ pinst->trx = NULL;
+ }
talloc_free(pinst);
}