summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/wil6210/main.c
diff options
context:
space:
mode:
authorLior David <qca_liord@qca.qualcomm.com>2016-08-22 12:42:19 +0300
committerKalle Valo <kvalo@qca.qualcomm.com>2016-08-31 10:31:03 +0300
commit5ffae43208ec160e584117fabee2cddc5ad0e39a (patch)
tree7d6485065f6fecd64b20deacd3bdf66c711a8c2a /drivers/net/wireless/ath/wil6210/main.c
parent47b1848d9fde5daf102f599be6e589a1d3c8da7d (diff)
downloadlinux-stable-5ffae43208ec160e584117fabee2cddc5ad0e39a.tar.gz
linux-stable-5ffae43208ec160e584117fabee2cddc5ad0e39a.tar.bz2
linux-stable-5ffae43208ec160e584117fabee2cddc5ad0e39a.zip
wil6210: fix protection of wil->scan_request
Currently the places that check wil->scan_request and call cfg80211_scan_done are not consistently protected, so there is a risk that cfg80211_scan_done will be called with NULL scan_request, causing a kernel crash. Fix this by using p2p_wdev_mutex in few other places that access scan_request. This makes sense since scan_request may point to p2p_wdev, and it is not worth the extra complexity of adding a new mutex. Signed-off-by: Lior David <qca_liord@qca.qualcomm.com> Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/wil6210/main.c')
-rw-r--r--drivers/net/wireless/ath/wil6210/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c
index d0b180cc3c60..7b7619c1f9f3 100644
--- a/drivers/net/wireless/ath/wil6210/main.c
+++ b/drivers/net/wireless/ath/wil6210/main.c
@@ -852,6 +852,7 @@ int wil_reset(struct wil6210_priv *wil, bool load_fw)
bitmap_zero(wil->status, wil_status_last);
mutex_unlock(&wil->wmi_mutex);
+ mutex_lock(&wil->p2p_wdev_mutex);
if (wil->scan_request) {
struct cfg80211_scan_info info = {
.aborted = true,
@@ -863,6 +864,7 @@ int wil_reset(struct wil6210_priv *wil, bool load_fw)
cfg80211_scan_done(wil->scan_request, &info);
wil->scan_request = NULL;
}
+ mutex_unlock(&wil->p2p_wdev_mutex);
wil_mask_irq(wil);
@@ -1055,6 +1057,7 @@ int __wil_down(struct wil6210_priv *wil)
wil_p2p_stop_radio_operations(wil);
+ mutex_lock(&wil->p2p_wdev_mutex);
if (wil->scan_request) {
struct cfg80211_scan_info info = {
.aborted = true,
@@ -1066,6 +1069,7 @@ int __wil_down(struct wil6210_priv *wil)
cfg80211_scan_done(wil->scan_request, &info);
wil->scan_request = NULL;
}
+ mutex_unlock(&wil->p2p_wdev_mutex);
wil_reset(wil, false);