mwifiex: block further commands after timeout
authorAmitkumar Karwar <akarwar@marvell.com>
Fri, 28 Feb 2014 03:35:15 +0000 (19:35 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 28 Feb 2014 19:33:46 +0000 (14:33 -0500)
This patch adds a check in command preparation routine.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/cmdevt.c

index 0958764d2baee7f1b308d487bdc0f4a55faedf78..83195d96e78ce45777e7fd7b3d84b3253f49481c 100644 (file)
@@ -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");