laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/21637 )
Change subject: gsm_lchan_name: assert on NULL lchan ...................................................................... gsm_lchan_name: assert on NULL lchan Steve Langasek <[email protected]> submitted some patches against downstream osmo-bsc 1.3.0 because some possible null derefences were detected by the compiler on Ubuntu s390x. Code has eveolved since then and patch doesn't apply directly anymore, since related code changed (we now use osmo_count in bsc_subscr_get). The compiled allegedly claimed some null dereference in gsm_lchan_name. In general code using that function seems to be doing checks for existing lchan before calling it, or assuming the lchan pointer is not null, so I couldn't find any major issue. However, let's add a OSMO_ASSERT to make sure we can easily identify the issue if an issue ever happens there, since the gsm_lchan_name should clearly only be called on non null pointers. Change-Id: If4d12cb1d95ee2a89244bb8f27df839871667387 --- M include/osmocom/bsc/gsm_data.h 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 6904266..584c0e6 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -937,6 +937,7 @@ static inline char *gsm_lchan_name(const struct gsm_lchan *lchan) { + OSMO_ASSERT(lchan); return lchan->name; } -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/21637 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: If4d12cb1d95ee2a89244bb8f27df839871667387 Gerrit-Change-Number: 21637 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <[email protected]> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <[email protected]> Gerrit-MessageType: merged
