summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHamad Kadmany <hkadmany@codeaurora.org>2016-12-26 10:33:29 +0200
committerHamad Kadmany <hkadmany@codeaurora.org>2016-12-26 10:33:29 +0200
commit221fbb9e16a3b67599660e29fb3b436660a67c13 (patch)
tree9c8fb26ef859e0626b0e67565428301c7f1e932a
parent7aada1c608d39bc247ed2ac337fdcf5469092ec4 (diff)
wil6210: missing reinit_completion in wmi_call
The code in wmi_call uses the wil->wmi_call completion structure to wait for a reply. In some scenarios, complete was called twice on the completion structure. This happened mainly with a disconnect event which can arrive both unsolicited and as a reply to a disconnect request. In this case the completion structure was left marked as "done" and the next wmi_call returned immediately with a corrupted reply buffer. This caused unexpected results including crashes. Fix this by adding the missing call to reinit_completion. CRs-Fixed: 1105246 Change-Id: I4de26881620dde4230d0a907bd0fd39bebe2bb3d Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
-rw-r--r--drivers/net/wireless/ath/wil6210/wmi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c
index daa7a33d12d8..f5575747d11e 100644
--- a/drivers/net/wireless/ath/wil6210/wmi.c
+++ b/drivers/net/wireless/ath/wil6210/wmi.c
@@ -964,6 +964,7 @@ int wmi_call(struct wil6210_priv *wil, u16 cmdid, void *buf, u16 len,
wil->reply_id = reply_id;
wil->reply_buf = reply;
wil->reply_size = reply_size;
+ reinit_completion(&wil->wmi_call);
spin_unlock(&wil->wmi_ev_lock);
rc = __wmi_send(wil, cmdid, buf, len);