summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBing Zhao <bzhao@marvell.com>2013-03-15 18:47:07 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-04-05 10:04:19 -0700
commite92c5efcb2af2afe9a7fa297dcc325f8d04469b3 (patch)
treebdc3065b60cba31201aa2d078f55ff6c37033e29
parent86302600f82d715647154e18a96245642f1bf71e (diff)
downloadlinux-stable-e92c5efcb2af2afe9a7fa297dcc325f8d04469b3.tar.gz
linux-stable-e92c5efcb2af2afe9a7fa297dcc325f8d04469b3.tar.bz2
linux-stable-e92c5efcb2af2afe9a7fa297dcc325f8d04469b3.zip
mwifiex: cancel cmd timer and free curr_cmd in shutdown process
commit 084c7189acb3f969c855536166042e27f5dd703f upstream. curr_cmd points to the command that is in processing or waiting for its command response from firmware. If the function shutdown happens to occur at this time we should cancel the cmd timer and put the command back to free queue. Tested-by: Marco Cesarano <marco@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/net/wireless/mwifiex/init.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c
index 54bb4839b57c..f9d9aedfd54b 100644
--- a/drivers/net/wireless/mwifiex/init.c
+++ b/drivers/net/wireless/mwifiex/init.c
@@ -584,6 +584,14 @@ mwifiex_shutdown_drv(struct mwifiex_adapter *adapter)
return ret;
}
+ /* cancel current command */
+ if (adapter->curr_cmd) {
+ dev_warn(adapter->dev, "curr_cmd is still in processing\n");
+ del_timer(&adapter->cmd_timer);
+ mwifiex_insert_cmd_to_free_q(adapter, adapter->curr_cmd);
+ adapter->curr_cmd = NULL;
+ }
+
/* shut down mwifiex */
dev_dbg(adapter->dev, "info: shutdown mwifiex...\n");