linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maya Erez <merez@codeaurora.org>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: Lior David <liord@codeaurora.org>,
	linux-wireless@vger.kernel.org, wil6210@qti.qualcomm.com,
	Maya Erez <merez@codeaurora.org>
Subject: [PATCH v3 3/8] wil6210: fix call to wil6210_disconnect during unload
Date: Wed,  9 May 2018 13:06:54 +0300	[thread overview]
Message-ID: <1525860419-6514-4-git-send-email-merez@codeaurora.org> (raw)
In-Reply-To: <1525860419-6514-1-git-send-email-merez@codeaurora.org>

From: Lior David <liord@codeaurora.org>

Move the call to wil6210_disconnect so it will be called
before unregister_netdevice. This is because it calls
netif_carrier_off which is forbidden to call on an
unregistered net device. Calling netif_carrier_off can
add a link watch event which might be handled after
net device was freed, causing a kernel oops.

Signed-off-by: Lior David <liord@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
---
 drivers/net/wireless/ath/wil6210/netdev.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/wil6210/netdev.c b/drivers/net/wireless/ath/wil6210/netdev.c
index 05e9408..eb6c14ed 100644
--- a/drivers/net/wireless/ath/wil6210/netdev.c
+++ b/drivers/net/wireless/ath/wil6210/netdev.c
@@ -457,16 +457,16 @@ void wil_vif_remove(struct wil6210_priv *wil, u8 mid)
 		return;
 	}
 
+	mutex_lock(&wil->mutex);
+	wil6210_disconnect(vif, NULL, WLAN_REASON_DEAUTH_LEAVING, false);
+	mutex_unlock(&wil->mutex);
+
 	ndev = vif_to_ndev(vif);
 	/* during unregister_netdevice cfg80211_leave may perform operations
 	 * such as stop AP, disconnect, so we only clear the VIF afterwards
 	 */
 	unregister_netdevice(ndev);
 
-	mutex_lock(&wil->mutex);
-	wil6210_disconnect(vif, NULL, WLAN_REASON_DEAUTH_LEAVING, false);
-	mutex_unlock(&wil->mutex);
-
 	if (any_active && vif->mid != 0)
 		wmi_port_delete(wil, vif->mid);
 
-- 
1.9.1

  parent reply	other threads:[~2018-05-09 10:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-09 10:06 [PATCH v3 0/8] wil6210 patches Maya Erez
2018-05-09 10:06 ` [PATCH v3 1/8] wil6210: disable tracing config option Maya Erez
2018-05-12  9:30   ` [v3,1/8] " Kalle Valo
2018-05-09 10:06 ` [PATCH v3 2/8] wil6210: align to latest auto generated wmi.h Maya Erez
2018-05-09 10:06 ` Maya Erez [this message]
2018-05-09 10:06 ` [PATCH v3 4/8] wil6210: change reply_size arg to u16 in wmi_call Maya Erez
2018-05-09 10:06 ` [PATCH v3 5/8] wil6210: move WMI functionality out of wil_cfg80211_mgmt_tx Maya Erez
2018-05-09 10:06 ` [PATCH v3 6/8] wil6210: Initialize reply struct of the WMI commands Maya Erez
2018-05-09 10:06 ` [PATCH v3 7/8] wil6210: remove unused rx_reorder members Maya Erez
2018-05-09 10:06 ` [PATCH v3 8/8] wil6210: rate limit wil_rx_refill error 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=1525860419-6514-4-git-send-email-merez@codeaurora.org \
    --to=merez@codeaurora.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=liord@codeaurora.org \
    --cc=wil6210@qti.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;
as well as URLs for NNTP newsgroup(s).