mac80211: fix an oops in ieee80211_scan_state_set_channel
authorHelmut Schaa <helmut.schaa@googlemail.com>
Sat, 25 Jul 2009 15:25:51 +0000 (17:25 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 29 Jul 2009 19:46:07 +0000 (15:46 -0400)
Fix an oops in ieee80211_scan_state_set_channel which was triggered
if the last scanned channel was skipped (for example due to regulatory
restrictions) by returning to the decision state after each skipped
channel.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/scan.c

index b376775e722f37c405d4b06944a3906b8e714a1b..147772a2977cf1b23434e3865ab260fc4331f8af 100644 (file)
@@ -605,8 +605,11 @@ static void ieee80211_scan_state_set_channel(struct ieee80211_local *local,
        /* advance state machine to next channel/band */
        local->scan_channel_idx++;
 
-       if (skip)
+       if (skip) {
+               /* if we skip this channel return to the decision state */
+               local->next_scan_state = SCAN_DECISION;
                return;
+       }
 
        /*
         * Probe delay is used to update the NAV, cf. 11.1.3.2.2