aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-12-05 01:01:38 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2018-01-12 03:28:14 +0100
commitfacda94cfbe0f8dbfbdf1206b9f6ade3ae92e2ea (patch)
tree24ac96284b8e6279cf571ea7617978de8e461f58
parentf6769df0cb01b70fdb523c62937cc4c466405b7e (diff)
fixup: neigh_meas_avg: detect invalid window size as <=0, log if invalid
-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 dfe12ed33..d62909db3 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),