Ensure TRX invariant
diff mbox

Message ID 1461257709-25977-1-git-send-email-msuraev@sysmocom.de
State Not Applicable
Headers show

Commit Message

Max April 21, 2016, 4:55 p.m. UTC
From: Max <msuraev@sysmocom.de>

There is implicit invariant in trx_phy_instance() which is actively used
by various hw-specific implementations to get TRX's phy instance. Let's
make sure there's explicit assertion for this because there's been
segfaults in the past related to it.
---
 include/osmo-bts/phy_link.h | 1 +
 1 file changed, 1 insertion(+)

Patch
diff mbox

diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h
index a559aa3..edc6cc0 100644
--- a/include/osmo-bts/phy_link.h
+++ b/include/osmo-bts/phy_link.h
@@ -125,6 +125,7 @@  void phy_user_statechg_notif(struct phy_instance *pinst, enum phy_link_state lin
 
 static inline struct phy_instance *trx_phy_instance(struct gsm_bts_trx *trx)
 {
+	OSMO_ASSERT(trx);
 	return trx->role_bts.l1h;
 }