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>
This commit is contained in:
Wojciech Dubowik
2022-05-17 14:12:41 +02:00
committed by David Bauer
parent d9b3877198
commit 7afab9604b

View File

@@ -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;
}