From: Maya Erez <qca_merez@qca.qualcomm.com>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: Lior David <qca_liord@qca.qualcomm.com>,
linux-wireless@vger.kernel.org, wil6210@qca.qualcomm.com,
Maya Erez <qca_merez@qca.qualcomm.com>
Subject: [PATCH 06/12] wil6210: missing reinit_completion in wmi_call
Date: Wed, 11 Jan 2017 18:12:42 +0200 [thread overview]
Message-ID: <1484151168-894-7-git-send-email-qca_merez@qca.qualcomm.com> (raw)
In-Reply-To: <1484151168-894-1-git-send-email-qca_merez@qca.qualcomm.com>
From: Lior David <qca_liord@qca.qualcomm.com>
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.
Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
---
drivers/net/wireless/ath/wil6210/wmi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c
index 585a0ec..7f13b09 100644
--- a/drivers/net/wireless/ath/wil6210/wmi.c
+++ b/drivers/net/wireless/ath/wil6210/wmi.c
@@ -957,6 +957,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);
--
1.9.1
next prev parent reply other threads:[~2017-01-11 16:13 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-11 16:12 [PATCH 00/12] wil6210 patches Maya Erez
2017-01-11 16:12 ` [PATCH 01/12] wil6210: add sysfs file for FTM calibration Maya Erez
2017-01-11 16:12 ` [PATCH 02/12] wil6210: add disable_ap_sme module parameter Maya Erez
2017-01-11 16:12 ` [PATCH 03/12] wil6210: support loading dedicated image for sparrow-plus devices Maya Erez
2017-01-11 16:12 ` [PATCH 04/12] wil6210: remove __func__ from debug printouts Maya Erez
2017-01-11 16:12 ` [PATCH 05/12] wil6210: support new WMI-only FW capability Maya Erez
2017-01-11 16:12 ` Maya Erez [this message]
2017-01-11 16:12 ` [PATCH 07/12] wil6210: protect against false interrupt during reset sequence Maya Erez
2017-01-11 16:12 ` [PATCH 08/12] wil6210: fix for broadcast workaround in PBSS Maya Erez
2017-01-11 16:12 ` [PATCH 09/12] wil6210: align to latest auto generated wmi.h Maya Erez
2017-01-11 16:12 ` [PATCH 10/12] wil6210: report association ID (AID) per station in debugfs Maya Erez
2017-01-11 16:12 ` [PATCH 11/12] wil6210: option to override A-BFT length in start AP/PCP Maya Erez
2017-01-11 16:12 ` [PATCH 12/12] wil6210: set dma mask to reflect device capability Maya Erez
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=1484151168-894-7-git-send-email-qca_merez@qca.qualcomm.com \
--to=qca_merez@qca.qualcomm.com \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=qca_liord@qca.qualcomm.com \
--cc=wil6210@qca.qualcomm.com \
/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