All of lore.kernel.org
 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 04/10] wil6210: fix call to wil6210_disconnect during unload
Date: Thu, 12 Apr 2018 11:08:40 +0300	[thread overview]
Message-ID: <1523520526-24997-5-git-send-email-merez@codeaurora.org> (raw)
In-Reply-To: <1523520526-24997-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-04-12  8:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-12  8:08 [PATCH 00/10] wil6210 patches Maya Erez
2018-04-12  8:08 ` [PATCH 01/10] wil6210: disable tracing config option Maya Erez
2018-04-12  8:08 ` [PATCH 02/10] wil6210: set/get EDMG channel through debugfs Maya Erez
2018-04-19 16:15   ` [02/10] " Kalle Valo
2018-04-22 12:40     ` merez
2018-04-24  9:47       ` Kalle Valo
2018-04-25  8:58         ` merez
2018-05-08 15:17           ` Kalle Valo
2018-04-12  8:08 ` [PATCH 03/10] wil6210: align to latest auto generated wmi.h Maya Erez
2018-04-12  8:08 ` Maya Erez [this message]
2018-04-12  8:08 ` [PATCH 05/10] wil6210: change reply_size arg to u16 in wmi_call Maya Erez
2018-04-12  8:08 ` [PATCH 06/10] wil6210: use country specific board file upon reg domain change Maya Erez
2018-04-12  8:08 ` [PATCH 07/10] wil6210: move WMI functionality out of wil_cfg80211_mgmt_tx Maya Erez
2018-04-12  8:08 ` [PATCH 08/10] wil6210: Initialize reply struct of the WMI commands Maya Erez
2018-04-12  8:08 ` [PATCH 09/10] wil6210: remove unused rx_reorder members Maya Erez
2018-04-12  8:08 ` [PATCH 10/10] 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=1523520526-24997-5-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.