iwlwifi: assume vif is NULL for internal scans and non-NULL otherwise
authorJohn W. Linville <linville@tuxdriver.com>
Thu, 22 Jul 2010 19:24:56 +0000 (15:24 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 26 Jul 2010 19:09:04 +0000 (15:09 -0400)
The current practice of checking vif for NULL in one place but not
another seems to confuse some static checkers, smatch in particular.
Since vif will only be NULL in the case of internal scans, adjust the
checks accordingly.

Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-agn-lib.c
drivers/net/wireless/iwlwifi/iwl3945-base.c

index dda71cd9aab124f49f0f24826ec44ff1073b57df..a1b6d202d57c0b77b4bd510ada832124486eeceb 100644 (file)
@@ -1234,7 +1234,10 @@ void iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
 
                IWL_DEBUG_INFO(priv, "Scanning while associated...\n");
                spin_lock_irqsave(&priv->lock, flags);
-               interval = vif ? vif->bss_conf.beacon_int : 0;
+               if (priv->is_internal_short_scan)
+                       interval = 0;
+               else
+                       interval = vif->bss_conf.beacon_int;
                spin_unlock_irqrestore(&priv->lock, flags);
 
                scan->suspend_time = 0;
index 9a7209d075c86d19ff630119eefd07671aca7e46..45a68457504658ee256cde19b22fce4b46edf7e2 100644 (file)
@@ -2881,7 +2881,10 @@ void iwl3945_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
                IWL_DEBUG_INFO(priv, "Scanning while associated...\n");
 
                spin_lock_irqsave(&priv->lock, flags);
-               interval = vif ? vif->bss_conf.beacon_int : 0;
+               if (priv->is_internal_short_scan)
+                       interval = 0;
+               else
+                       interval = vif->bss_conf.beacon_int;
                spin_unlock_irqrestore(&priv->lock, flags);
 
                scan->suspend_time = 0;