diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2012-01-02 19:18:40 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-01-03 14:40:45 -0500 |
commit | b015dbc0f95eef34819515bd403a62569bca23df (patch) | |
tree | 628a5820226435e6f3b2e302c5dda8a80368c1d7 | |
parent | 09009512e5e7ab341b1554a256f81dd512c1f4bf (diff) |
mwifiex: fix crash during simultaneous scan and connect
If 'iw connect' command is fired when driver is already busy in
serving 'iw scan' command, ssid specific scan operation for connect
is skipped. In this case cmd wait queue handler gets called with no
command in queue (i.e. adapter->cmd_queued = NULL).
This patch adds a NULL check in mwifiex_wait_queue_complete()
routine to fix crash observed during simultaneous scan and assoc
operations.
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>
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_ioctl.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c index ea4a29b7e331..1679c2593b7b 100644 --- a/drivers/net/wireless/mwifiex/sta_ioctl.c +++ b/drivers/net/wireless/mwifiex/sta_ioctl.c | |||
@@ -55,9 +55,14 @@ int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter) | |||
55 | { | 55 | { |
56 | bool cancel_flag = false; | 56 | bool cancel_flag = false; |
57 | int status = adapter->cmd_wait_q.status; | 57 | int status = adapter->cmd_wait_q.status; |
58 | struct cmd_ctrl_node *cmd_queued = adapter->cmd_queued; | 58 | struct cmd_ctrl_node *cmd_queued; |
59 | 59 | ||
60 | if (!adapter->cmd_queued) | ||
61 | return 0; | ||
62 | |||
63 | cmd_queued = adapter->cmd_queued; | ||
60 | adapter->cmd_queued = NULL; | 64 | adapter->cmd_queued = NULL; |
65 | |||
61 | dev_dbg(adapter->dev, "cmd pending\n"); | 66 | dev_dbg(adapter->dev, "cmd pending\n"); |
62 | atomic_inc(&adapter->cmd_pending); | 67 | atomic_inc(&adapter->cmd_pending); |
63 | 68 | ||