diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2015-01-07 12:57:39 +0100 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-01-23 18:03:15 +0100 |
commit | e00483f74682ea6aa7f3839a980c7cdb548de4d2 (patch) | |
tree | fd57340f2e489025363c619ef2c6f44f28814033 /drivers/net/wireless/mwifiex/scan.c | |
parent | ath9k: Fix no-ack frame status (diff) | |
download | linux-e00483f74682ea6aa7f3839a980c7cdb548de4d2.tar.xz linux-e00483f74682ea6aa7f3839a980c7cdb548de4d2.zip |
mwifiex: check driver status in connect and scan handlers
Ignore scan and connection requests from cfg80211 when driver
unload is in process or previous command has timed out due to
a firmware bug. This patch fixes corner case system crash
issues.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/mwifiex/scan.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/scan.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c index 984a7a4fa93b..e304f0731647 100644 --- a/drivers/net/wireless/mwifiex/scan.c +++ b/drivers/net/wireless/mwifiex/scan.c @@ -1429,6 +1429,12 @@ int mwifiex_scan_networks(struct mwifiex_private *priv, return -EBUSY; } + if (adapter->surprise_removed || adapter->is_cmd_timedout) { + dev_err(adapter->dev, + "Ignore scan. Card removed or firmware in bad state\n"); + return -EFAULT; + } + spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags); adapter->scan_processing = true; spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags); |