summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWojciech Dubowik2022-05-17 12:12:41 +0000
committerDavid Bauer2022-05-17 14:21:14 +0000
commit7afab9604b580266a81935fb1d9df4c3b33831a3 (patch)
treecb87b34ad9a97d6d0d73fc1cd7eda7cb43c63833
parentd9b3877198180b4765614c16fc971670cee1d688 (diff)
downloadusteer-7afab9604b580266a81935fb1d9df4c3b33831a3.tar.gz
usteer: Fix better candidate not being set in policy
The candidate is never set in this loop. Fix it by setting it to the first valid entry. Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@westermo.com>
-rw-r--r--policy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/policy.c b/policy.c
index a7efc06..8155e24 100644
--- a/policy.c
+++ b/policy.c
@@ -143,7 +143,7 @@ find_better_candidate(struct sta_info *si_ref, struct uevent *ev, uint32_t requi
ev->select_reasons = reasons;
}
- if (candidate && si->signal > candidate->signal)
+ if (!candidate || si->signal > candidate->signal)
candidate = si;
}