diff options
| author | Hamad Kadmany <hkadmany@codeaurora.org> | 2017-04-13 14:38:20 +0300 |
|---|---|---|
| committer | Hamad Kadmany <hkadmany@codeaurora.org> | 2017-04-13 14:38:20 +0300 |
| commit | abd1cc456b805b0ac2093e800aeeb3034c8708d4 (patch) | |
| tree | 707c41197b175b04ee96e0edadd1be0e87312677 /drivers/net/wireless/ath/wil6210/wmi.c | |
| parent | 4a4051e573b6896ba047fd2a1f6163c6165f8fb7 (diff) | |
wil6210: Fix protection against connections during reset
Existing code that ignores connection events during
reset flow will never take effect since it locks the
same mutex taken by the reset flow.
In addition, in case of unsolicited disconnect events ignore
those as well since device is about to get reset.
Change-Id: I132040822b8c1b3d1d92965d578ed5bee0b3d1cf
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ath/wil6210/wmi.c')
| -rw-r--r-- | drivers/net/wireless/ath/wil6210/wmi.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c index 83ef6eb57e53..41afbdc34c18 100644 --- a/drivers/net/wireless/ath/wil6210/wmi.c +++ b/drivers/net/wireless/ath/wil6210/wmi.c @@ -518,16 +518,16 @@ static void wmi_evt_connect(struct wil6210_priv *wil, int id, void *d, int len) assoc_resp_ielen = 0; } - mutex_lock(&wil->mutex); if (test_bit(wil_status_resetting, wil->status) || !test_bit(wil_status_fwready, wil->status)) { wil_err(wil, "status_resetting, cancel connect event, CID %d\n", evt->cid); - mutex_unlock(&wil->mutex); /* no need for cleanup, wil_reset will do that */ return; } + mutex_lock(&wil->mutex); + if ((wdev->iftype == NL80211_IFTYPE_STATION) || (wdev->iftype == NL80211_IFTYPE_P2P_CLIENT)) { if (!test_bit(wil_status_fwconnecting, wil->status)) { @@ -631,6 +631,13 @@ static void wmi_evt_disconnect(struct wil6210_priv *wil, int id, wil->sinfo_gen++; + if (test_bit(wil_status_resetting, wil->status) || + !test_bit(wil_status_fwready, wil->status)) { + wil_err(wil, "status_resetting, cancel disconnect event\n"); + /* no need for cleanup, wil_reset will do that */ + return; + } + mutex_lock(&wil->mutex); wil6210_disconnect(wil, evt->bssid, reason_code, true); mutex_unlock(&wil->mutex); |
