diff options
author | Bing Zhao <bzhao@marvell.com> | 2013-03-16 01:47:07 (GMT) |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-03-18 19:20:38 (GMT) |
commit | 084c7189acb3f969c855536166042e27f5dd703f (patch) | |
tree | 215f39dcee2c53e7f59459c26296ec934fa52bf6 /drivers/net | |
parent | a3e240cacc93a06bff3313e28938e980d01a2160 (diff) | |
download | linux-084c7189acb3f969c855536166042e27f5dd703f.tar.xz |
mwifiex: cancel cmd timer and free curr_cmd in shutdown process
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.
Cc: <stable@vger.kernel.org> # 3.8
Tested-by: Marco Cesarano <marco@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/mwifiex/init.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c index e38aa9b..0ff4c37 100644 --- a/drivers/net/wireless/mwifiex/init.c +++ b/drivers/net/wireless/mwifiex/init.c @@ -709,6 +709,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"); |