diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2012-03-02 16:23:36 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-03-05 15:53:49 -0500 |
commit | ebecdcc12fed5d3c81853dea61a0a78a5aefab52 (patch) | |
tree | 0a73dd36e34f8a11465447f2e8c9106e0fb296d6 /drivers/net/wireless | |
parent | 8f526ab4aa1b145bda2baf56e223050c7ef3e1b0 (diff) |
rtlwifi: rtl8192c: Prevent sleeping from invalid context in rtl8192cu
When driver rtl8192cu is used with the debug level set to 3 or greater,
the result is "sleeping function called from invalid context" due to
an rcu_read_lock() call in the DM refresh routine in driver rtl8192c.
This lock is not necessary as the USB driver does not use the struct
being protected, thus the lock is set only when a PCI interface is
active.
This bug is reported in https://bugzilla.kernel.org/show_bug.cgi?id=42775.
Reported-by: Ronald Wahl <ronald.wahl@raritan.com>
Tested-by: Ronald Wahl <ronald.wahl@raritan.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Cc: Ronald Wahl <ronald.wahl@raritan.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c index cb5535cf3ae2..8646ff2a55ce 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c +++ b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c | |||
@@ -1201,13 +1201,18 @@ static void rtl92c_dm_refresh_rate_adaptive_mask(struct ieee80211_hw *hw) | |||
1201 | "PreState = %d, CurState = %d\n", | 1201 | "PreState = %d, CurState = %d\n", |
1202 | p_ra->pre_ratr_state, p_ra->ratr_state); | 1202 | p_ra->pre_ratr_state, p_ra->ratr_state); |
1203 | 1203 | ||
1204 | rcu_read_lock(); | 1204 | /* Only the PCI card uses sta in the update rate table |
1205 | sta = ieee80211_find_sta(mac->vif, mac->bssid); | 1205 | * callback routine */ |
1206 | if (rtlhal->interface == INTF_PCI) { | ||
1207 | rcu_read_lock(); | ||
1208 | sta = ieee80211_find_sta(mac->vif, mac->bssid); | ||
1209 | } | ||
1206 | rtlpriv->cfg->ops->update_rate_tbl(hw, sta, | 1210 | rtlpriv->cfg->ops->update_rate_tbl(hw, sta, |
1207 | p_ra->ratr_state); | 1211 | p_ra->ratr_state); |
1208 | 1212 | ||
1209 | p_ra->pre_ratr_state = p_ra->ratr_state; | 1213 | p_ra->pre_ratr_state = p_ra->ratr_state; |
1210 | rcu_read_unlock(); | 1214 | if (rtlhal->interface == INTF_PCI) |
1215 | rcu_read_unlock(); | ||
1211 | } | 1216 | } |
1212 | } | 1217 | } |
1213 | } | 1218 | } |