diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2017-12-05 01:01:38 +0100 |
---|---|---|
committer | Ivan Kluchnikov <kluchnikovi@gmail.com> | 2018-09-03 15:00:10 +0300 |
commit | 42b39418cdc94eb76815180cb2a9ebe4aa1bcb7e (patch) | |
tree | 14107aaaf3eb64448e69b9a33f3bcba35cefc3ed | |
parent | 133faf012160c767bf78b3a7f70646b5449b36de (diff) |
fixup: neigh_meas_avg: detect invalid window size as <=0, log if invalid
Change-Id: I162eb751c36b4f3c959706df1c640c550742a95e
-rw-r--r-- | openbsc/src/libbsc/handover_decision.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/openbsc/src/libbsc/handover_decision.c b/openbsc/src/libbsc/handover_decision.c index 354363ac2..98c9dce87 100644 --- a/openbsc/src/libbsc/handover_decision.c +++ b/openbsc/src/libbsc/handover_decision.c @@ -80,8 +80,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), |