diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-03-05 14:31:00 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-03-07 16:03:01 -0500 |
commit | f4d6082d53c588036a1c37891cb7d65088be13f5 (patch) | |
tree | 4303d0f6f73e56bbe6927155c9a6cba8d7ffc9ce | |
parent | 6c5ef8a7059e4f7adc37b337face8b0a8cbd4f48 (diff) |
iwlwifi: fix locking unbalance in 4965 rate scale
This patch fixes locking unbalance after adding rcu locking
for sta
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965-rs.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c index 306fbdc6e62f..25e73864c2a4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c | |||
@@ -852,19 +852,18 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev, | |||
852 | 852 | ||
853 | sta = sta_info_get(local, hdr->addr1); | 853 | sta = sta_info_get(local, hdr->addr1); |
854 | 854 | ||
855 | if (!sta || !sta->rate_ctrl_priv) { | 855 | if (!sta || !sta->rate_ctrl_priv) |
856 | rcu_read_unlock(); | 856 | goto out; |
857 | return; | 857 | |
858 | } | ||
859 | 858 | ||
860 | lq_sta = (struct iwl4965_lq_sta *)sta->rate_ctrl_priv; | 859 | lq_sta = (struct iwl4965_lq_sta *)sta->rate_ctrl_priv; |
861 | 860 | ||
862 | if (!priv->lq_mngr.lq_ready) | 861 | if (!priv->lq_mngr.lq_ready) |
863 | return; | 862 | goto out; |
864 | 863 | ||
865 | if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) && | 864 | if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) && |
866 | !lq_sta->ibss_sta_added) | 865 | !lq_sta->ibss_sta_added) |
867 | return; | 866 | goto out; |
868 | 867 | ||
869 | table = &lq_sta->lq; | 868 | table = &lq_sta->lq; |
870 | active_index = lq_sta->active_tbl; | 869 | active_index = lq_sta->active_tbl; |
@@ -915,8 +914,7 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev, | |||
915 | tx_resp->control.tx_rate->bitrate)) { | 914 | tx_resp->control.tx_rate->bitrate)) { |
916 | IWL_DEBUG_RATE("initial rate does not match 0x%x\n", | 915 | IWL_DEBUG_RATE("initial rate does not match 0x%x\n", |
917 | tx_mcs.rate_n_flags); | 916 | tx_mcs.rate_n_flags); |
918 | rcu_read_unlock(); | 917 | goto out; |
919 | return; | ||
920 | } | 918 | } |
921 | 919 | ||
922 | /* Update frame history window with "failure" for each Tx retry. */ | 920 | /* Update frame history window with "failure" for each Tx retry. */ |
@@ -1025,6 +1023,7 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev, | |||
1025 | 1023 | ||
1026 | /* See if there's a better rate or modulation mode to try. */ | 1024 | /* See if there's a better rate or modulation mode to try. */ |
1027 | rs_rate_scale_perform(priv, dev, hdr, sta); | 1025 | rs_rate_scale_perform(priv, dev, hdr, sta); |
1026 | out: | ||
1028 | rcu_read_unlock(); | 1027 | rcu_read_unlock(); |
1029 | return; | 1028 | return; |
1030 | } | 1029 | } |
@@ -2229,8 +2228,7 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev, | |||
2229 | if (!ieee80211_is_data(fc) || is_multicast_ether_addr(hdr->addr1) || | 2228 | if (!ieee80211_is_data(fc) || is_multicast_ether_addr(hdr->addr1) || |
2230 | !sta || !sta->rate_ctrl_priv) { | 2229 | !sta || !sta->rate_ctrl_priv) { |
2231 | sel->rate = rate_lowest(local, sband, sta); | 2230 | sel->rate = rate_lowest(local, sband, sta); |
2232 | rcu_read_unlock(); | 2231 | goto out; |
2233 | return; | ||
2234 | } | 2232 | } |
2235 | 2233 | ||
2236 | lq_sta = (struct iwl4965_lq_sta *)sta->rate_ctrl_priv; | 2234 | lq_sta = (struct iwl4965_lq_sta *)sta->rate_ctrl_priv; |
@@ -2257,14 +2255,15 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev, | |||
2257 | goto done; | 2255 | goto done; |
2258 | } | 2256 | } |
2259 | 2257 | ||
2260 | done: | 2258 | done: |
2261 | if ((i < 0) || (i > IWL_RATE_COUNT)) { | 2259 | if ((i < 0) || (i > IWL_RATE_COUNT)) { |
2262 | sel->rate = rate_lowest(local, sband, sta); | 2260 | sel->rate = rate_lowest(local, sband, sta); |
2263 | return; | 2261 | goto out; |
2264 | } | 2262 | } |
2265 | rcu_read_unlock(); | ||
2266 | 2263 | ||
2267 | sel->rate = &priv->ieee_rates[i]; | 2264 | sel->rate = &priv->ieee_rates[i]; |
2265 | out: | ||
2266 | rcu_read_unlock(); | ||
2268 | } | 2267 | } |
2269 | 2268 | ||
2270 | static void *rs_alloc_sta(void *priv, gfp_t gfp) | 2269 | static void *rs_alloc_sta(void *priv, gfp_t gfp) |