aboutsummaryrefslogtreecommitdiffstats
path: root/src/libbsc/meas_rep.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libbsc/meas_rep.c')
-rw-r--r--src/libbsc/meas_rep.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libbsc/meas_rep.c b/src/libbsc/meas_rep.c
index 808103d28..2a8d5ac5e 100644
--- a/src/libbsc/meas_rep.c
+++ b/src/libbsc/meas_rep.c
@@ -75,7 +75,10 @@ int get_meas_rep_avg(const struct gsm_lchan *lchan,
int avg = 0;
if (num < 1)
- return 0;
+ return -EINVAL;
+
+ if (num > lchan->meas_rep_cnt)
+ return -EINVAL;
idx = calc_initial_idx(ARRAY_SIZE(lchan->meas_rep),
lchan->meas_rep_idx, num);