]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
mac80211: avoid uninitialized var warning in ieee80211_scan_cancel
authorJohn W. Linville <linville@tuxdriver.com>
Wed, 6 Oct 2010 20:40:40 +0000 (16:40 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 6 Oct 2010 20:40:40 +0000 (16:40 -0400)
net/mac80211/scan.c: In function ‘ieee80211_scan_cancel’:
net/mac80211/scan.c:794: warning: ‘finish’ may be used uninitialized in this function

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

index 80e017df5f31679f5af283701ed2aa30be9ac1fe..523db930dabbde0eea60948750a0a1cb0204c07b 100644 (file)
@@ -791,7 +791,8 @@ int ieee80211_request_internal_scan(struct ieee80211_sub_if_data *sdata,
  */
 void ieee80211_scan_cancel(struct ieee80211_local *local)
 {
-       bool abortscan, finish;
+       bool abortscan;
+       bool finish = false;
 
        /*
         * We are only canceling software scan, or deferred scan that was not
@@ -818,7 +819,7 @@ void ieee80211_scan_cancel(struct ieee80211_local *local)
        if (abortscan) {
                /* The scan is canceled, but stop work from being pending */
                cancel_delayed_work_sync(&local->scan_work);
-               if (finish)
-                       __ieee80211_scan_completed_finish(&local->hw, false);
        }
+       if (finish)
+               __ieee80211_scan_completed_finish(&local->hw, false);
 }