From: Wojciech Dubowik Date: Tue, 17 May 2022 12:12:41 +0000 (+0200) Subject: usteer: Fix better candidate not being set in policy X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=7afab9604b580266a81935fb1d9df4c3b33831a3;p=project%2Fusteer.git 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 --- 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; }