mwifiex: fix system crash observed during initialisation
authorZhaoyang Liu <liuzy@marvell.com>
Wed, 22 Jul 2015 11:53:44 +0000 (04:53 -0700)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 6 Aug 2015 07:13:56 +0000 (10:13 +0300)
System crash was observed if one of the driver initialisation
commands is timed out. The reason is our timeout handler triggers
firmware dump, meanwhile driver initialisation error paths have
already freed the adapter structure.

Firmware hasn't yet completely initialized. So collecting firmware
dump is not needed in this case. Command timeout handler is
modified in this patch to fix the crash issue.

Signed-off-by: Zhaoyang Liu <liuzy@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/mwifiex/cmdevt.c

index 27b778d5164e99f1ce969effe749dec60d5ca9c3..45ae38e32621805edb24168963a6ee915754148c 100644 (file)
@@ -979,8 +979,10 @@ mwifiex_cmd_timeout_func(unsigned long function_context)
                        mwifiex_cancel_pending_ioctl(adapter);
                }
        }
-       if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING)
+       if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING) {
                mwifiex_init_fw_complete(adapter);
+               return;
+       }
 
        if (adapter->if_ops.device_dump)
                adapter->if_ops.device_dump(adapter);