aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc
diff options
context:
space:
mode:
Diffstat (limited to 'src/osmo-bsc')
-rw-r--r--src/osmo-bsc/meas_rep.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/osmo-bsc/meas_rep.c b/src/osmo-bsc/meas_rep.c
index 73d9a1f21..ba5b9210f 100644
--- a/src/osmo-bsc/meas_rep.c
+++ b/src/osmo-bsc/meas_rep.c
@@ -27,6 +27,10 @@
static int get_field(const struct gsm_meas_rep *rep,
enum meas_rep_field field)
{
+ /* Uninitialized array index? */
+ if (!rep->lchan)
+ return -EINVAL;
+
switch (field) {
case MEAS_REP_DL_RXLEV_FULL:
if (!(rep->flags & MEAS_REP_F_DL_VALID))
@@ -52,9 +56,9 @@ static int get_field(const struct gsm_meas_rep *rep,
return rep->ul.full.rx_qual;
case MEAS_REP_UL_RXQUAL_SUB:
return rep->ul.sub.rx_qual;
+ default:
+ return -EINVAL;
}
-
- return 0;
}