remote: close file on usteer_init_local_id fread fail
[project/usteer.git] / policy.c
index bb10be58963be2e16eb321f2e815f9a2a022ba3c..8c5d244b35d8735f0918dfd8514d0abea9c5cd11 100644 (file)
--- a/policy.c
+++ b/policy.c
@@ -264,14 +264,15 @@ static void
 usteer_roam_set_state(struct sta_info *si, enum roam_trigger_state state,
                      struct uevent *ev)
 {
+       /* NOP in case we remain idle */
+       if (si->roam_state == state && si->roam_state == ROAM_TRIGGER_IDLE) {
+               si->roam_tries = 0;
+               return;
+       }
+
        si->roam_event = current_time;
 
        if (si->roam_state == state) {
-               if (si->roam_state == ROAM_TRIGGER_IDLE) {
-                       si->roam_tries = 0;
-                       return;
-               }
-
                si->roam_tries++;
        } else {
                si->roam_tries = 0;
@@ -477,8 +478,6 @@ usteer_local_node_snr_kick(struct usteer_local_node *ln)
                if (si->below_min_snr <= min_count)
                        continue;
 
-               si->kick_count++;
-
                ev.type = UEV_SIGNAL_KICK;
                ev.threshold.cur = si->signal;
                ev.count = si->kick_count;