From: Amitkumar Karwar Date: Fri, 28 Feb 2014 03:35:15 +0000 (-0800) Subject: mwifiex: block further commands after timeout X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=38ec3f3f6142d1517ce0f1c96502fd1c05d2fc52;p=linux-beck.git mwifiex: block further commands after timeout This patch adds a check in command preparation routine. Signed-off-by: Amitkumar Karwar Signed-off-by: Bing Zhao Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c index 0958764d2bae..83195d96e78c 100644 --- a/drivers/net/wireless/mwifiex/cmdevt.c +++ b/drivers/net/wireless/mwifiex/cmdevt.c @@ -514,6 +514,11 @@ int mwifiex_send_cmd(struct mwifiex_private *priv, u16 cmd_no, return -1; } + if (adapter->num_cmd_timeout) { + dev_err(adapter->dev, "PREP_CMD: FW is in bad state\n"); + return -1; + } + if (adapter->hw_status == MWIFIEX_HW_STATUS_RESET) { if (cmd_no != HostCmd_CMD_FUNC_INIT) { dev_err(adapter->dev, "PREP_CMD: FW in reset state\n");