From: Larry Finger <Larry.Finger@lwfinger.net>
To: kvalo@codeaurora.org
Cc: devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org,
Larry Finger <Larry.Finger@lwfinger.net>,
Pavel Andrianov <andrianov@ispras.ru>
Subject: [PATCH 2/6] rtlwifi: rtl8188ee: Fix potential race condition
Date: Sat, 25 Jun 2016 13:37:43 -0500 [thread overview]
Message-ID: <1466879867-2499-3-git-send-email-Larry.Finger@lwfinger.net> (raw)
In-Reply-To: <1466879867-2499-1-git-send-email-Larry.Finger@lwfinger.net>
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 <andrianov@ispras.ru>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Pavel Andrianov <andrianov@ispras.ru>
---
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c
index db9a782..7f2650d 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c
@@ -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);
}
--
2.1.4
next prev parent reply other threads:[~2016-06-25 18:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-25 18:37 [PATCH 0/6] rtlwifi: Miscellaneous fixes and cleanups Larry Finger
2016-06-25 18:37 ` [PATCH 1/6] rtlwifi: Remove unused parameter from rtl_ps_set_rf_state() Larry Finger
2016-07-05 14:32 ` [1/6] " Kalle Valo
2016-06-25 18:37 ` Larry Finger [this message]
2016-06-25 18:37 ` [PATCH 3/6] rtlwifi: rtl8192ee: Fix potential race condition Larry Finger
2016-06-25 18:37 ` [PATCH 4/6] rtlwifi: rtl8723be: " Larry Finger
2016-06-25 18:37 ` [PATCH 5/6] rtlwifi: rtl8723ae: " Larry Finger
2016-06-25 18:37 ` [PATCH 6/6] rtlwifi: rtl8821ae: " Larry Finger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1466879867-2499-3-git-send-email-Larry.Finger@lwfinger.net \
--to=larry.finger@lwfinger.net \
--cc=andrianov@ispras.ru \
--cc=devel@driverdev.osuosl.org \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).