aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2020-11-28 01:03:24 +0100
committerAlexander Couzens <lynxis@fe80.eu>2020-11-28 01:03:38 +0100
commit60e32803721bf69e59eb4550d5df77556ba4be81 (patch)
tree3564d43f167dd49afec3937794f01199c54412e0 /src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
parent55d7ee57cf578ed22d9efa0f7d9fe7252a2ccf8e (diff)
bts_ipaccess_nanobts: check if msgb_alloc fails
Diffstat (limited to 'src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c')
-rw-r--r--src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
index b7239326c..6d64a4bb4 100644
--- a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
+++ b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
@@ -32,6 +32,8 @@ struct msgb *nanobts_attr_bts_get(struct gsm_bts *bts)
uint8_t buf[256];
int rlt;
msgb = msgb_alloc(1024, "nanobts_attr_bts");
+ if (!msgb)
+ return NULL;
memcpy(buf, "\x55\x5b\x61\x67\x6d\x73", 6);
msgb_tv_fixed_put(msgb, NM_ATT_INTERF_BOUND, 6, buf);
@@ -104,6 +106,8 @@ struct msgb *nanobts_attr_nse_get(struct gsm_bts *bts)
struct msgb *msgb;
uint8_t buf[256];
msgb = msgb_alloc(1024, "nanobts_attr_bts");
+ if (!msgb)
+ return NULL;
/* NSEI 925 */
buf[0] = bts->gprs.nse.nsei >> 8;
@@ -140,6 +144,8 @@ struct msgb *nanobts_attr_cell_get(struct gsm_bts *bts)
struct msgb *msgb;
uint8_t buf[256];
msgb = msgb_alloc(1024, "nanobts_attr_bts");
+ if (!msgb)
+ return NULL;
/* routing area code */
buf[0] = bts->gprs.rac;
@@ -197,6 +203,8 @@ struct msgb *nanobts_attr_nscv_get(struct gsm_bts *bts)
struct msgb *msgb;
uint8_t buf[256];
msgb = msgb_alloc(1024, "nanobts_attr_bts");
+ if (!msgb)
+ return NULL;
/* 925 */
buf[0] = bts->gprs.nsvc[0].nsvci >> 8;
@@ -240,6 +248,8 @@ struct msgb *nanobts_attr_radio_get(struct gsm_bts *bts,
struct msgb *msgb;
uint8_t buf[256];
msgb = msgb_alloc(1024, "nanobts_attr_bts");
+ if (!msgb)
+ return NULL;
/* number of -2dB reduction steps / Pn */
msgb_tv_put(msgb, NM_ATT_RF_MAXPOWR_R, trx->max_power_red / 2);