Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[pandora-kernel.git] / drivers / net / wireless / rtlwifi / rtl8192ce / trx.c
index 8a67372..aa2b581 100644 (file)
@@ -252,9 +252,9 @@ static void _rtl92ce_query_rxphystatus(struct ieee80211_hw *hw,
        struct rtl_priv *rtlpriv = rtl_priv(hw);
        struct phy_sts_cck_8192s_t *cck_buf;
        s8 rx_pwr_all, rx_pwr[4];
-       u8 rf_rx_num, evm, pwdb_all;
+       u8 evm, pwdb_all, rf_rx_num = 0;
        u8 i, max_spatial_stream;
-       u32 rssi, total_rssi;
+       u32 rssi, total_rssi = 0;
        bool is_cck_rate;
 
        is_cck_rate = RX_HAL_IS_CCK_RATE(pdesc);
@@ -463,7 +463,7 @@ static void _rtl92ce_update_rxsignalstatistics(struct ieee80211_hw *hw,
                                               struct rtl_stats *pstats)
 {
        struct rtl_priv *rtlpriv = rtl_priv(hw);
-       int weighting;
+       int weighting = 0;
 
        if (rtlpriv->stats.recv_signal_power == 0)
                rtlpriv->stats.recv_signal_power = pstats->recvsignalpower;
@@ -730,7 +730,7 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
        struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
        struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
        bool defaultadapter = true;
-       struct ieee80211_sta *sta = ieee80211_find_sta(mac->vif, mac->bssid);
+       struct ieee80211_sta *sta;
        u8 *pdesc = (u8 *) pdesc_tx;
        struct rtl_tcb_desc tcb_desc;
        u8 *qc = ieee80211_get_qos_ctl(hdr);
@@ -810,10 +810,13 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
                SET_TX_DESC_LINIP(pdesc, 0);
                SET_TX_DESC_PKT_SIZE(pdesc, (u16) skb->len);
 
+               rcu_read_lock();
+               sta = ieee80211_find_sta(mac->vif, mac->bssid);
                if (sta) {
                        u8 ampdu_density = sta->ht_cap.ampdu_density;
                        SET_TX_DESC_AMPDU_DENSITY(pdesc, ampdu_density);
                }
+               rcu_read_unlock();
 
                if (info->control.hw_key) {
                        struct ieee80211_key_conf *keyconf =