[PATCH] Ensure TRX invariant

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

msuraev at sysmocom.de msuraev at sysmocom.de
Thu Apr 21 16:55:09 UTC 2016


From: Max <msuraev at 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(+)

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;
 }
 
-- 
2.8.1




More information about the OpenBSC mailing list