aboutsummaryrefslogtreecommitdiffstats
path: root/src/libbsc
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-12-05 01:01:38 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2018-01-19 16:03:16 +0100
commit186e47816427187a6317ec4022e451506a4cef7a (patch)
tree219ffcffca31ac7113013b3066f28366b17b7454 /src/libbsc
parent11e31c706663f586e78b531e401de562a07e0785 (diff)
fixup: neigh_meas_avg: detect invalid window size as <=0, log if invalid
Diffstat (limited to 'src/libbsc')
-rw-r--r--src/libbsc/handover_decision.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c
index 04ca14451..1ad4b3672 100644
--- a/src/libbsc/handover_decision.c
+++ b/src/libbsc/handover_decision.c
@@ -103,8 +103,10 @@ static int neigh_meas_avg(struct neigh_meas_proc *nmp, int window)
if (window < nmp->rxlev_cnt)
window = nmp->rxlev_cnt;
/* this should never happen */
- if (window == 0)
+ if (window <= 0) {
+ LOGP(DHO, LOGL_ERROR, "Requested Neighbor RxLev for invalid window size of %d\n", window);
return 0;
+ }
idx = calc_initial_idx(ARRAY_SIZE(nmp->rxlev),
nmp->rxlev_cnt % ARRAY_SIZE(nmp->rxlev),