]> Git Repo - linux.git/commitdiff
rtlwifi: rtl8188ee: Fix potential race condition
authorLarry Finger <[email protected]>
Sat, 25 Jun 2016 18:37:43 +0000 (13:37 -0500)
committerKalle Valo <[email protected]>
Tue, 5 Jul 2016 14:31:41 +0000 (17:31 +0300)
Flag rfchange_inprogress in struct rtl_ps_ctl is protected by a spinlock
in most routines but not in rtl88e_dm_watchdog(), which could
lead to a race condition. The necessary locking to prevent this condition
is added.

Reported-by: Pavel Andrianov <[email protected]>
Signed-off-by: Larry Finger <[email protected]>
Cc: Pavel Andrianov <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c

index 6e7b673ae89895465f8e051785dfe31e051fc89e..f936a491371b718f7af492c5bd152add18afe19f 100644 (file)
@@ -1790,6 +1790,7 @@ void rtl88e_dm_watchdog(struct ieee80211_hw *hw)
        if (ppsc->p2p_ps_info.p2p_ps_mode)
                fw_ps_awake = false;
 
+       spin_lock(&rtlpriv->locks.rf_ps_lock);
        if ((ppsc->rfpwr_state == ERFON) &&
            ((!fw_current_inpsmode) && fw_ps_awake) &&
            (!ppsc->rfchange_inprogress)) {
@@ -1802,4 +1803,5 @@ void rtl88e_dm_watchdog(struct ieee80211_hw *hw)
                rtl88e_dm_check_edca_turbo(hw);
                rtl88e_dm_antenna_diversity(hw);
        }
+       spin_unlock(&rtlpriv->locks.rf_ps_lock);
 }
This page took 0.06463 seconds and 4 git commands to generate.