diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2017-12-05 01:01:38 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2018-01-12 03:28:14 +0100 |
commit | facda94cfbe0f8dbfbdf1206b9f6ade3ae92e2ea (patch) | |
tree | 24ac96284b8e6279cf571ea7617978de8e461f58 /src | |
parent | f6769df0cb01b70fdb523c62937cc4c466405b7e (diff) |
fixup: neigh_meas_avg: detect invalid window size as <=0, log if invalid
Change-Id: I8c5d0642aeb4fbee73a035b9f73cf3a09b1bcf90
Diffstat (limited to 'src')
-rw-r--r-- | src/libbsc/handover_decision.c | 4 |
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), |