Skip to content

Commit

Permalink
mwifiex: fix crash during simultaneous scan and connect
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Amitkumar Karwar authored and John W. Linville committed Jan 3, 2012
1 parent 0900951 commit b015dbc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/net/wireless/mwifiex/sta_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,14 @@ int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter)
{
bool cancel_flag = false;
int status = adapter->cmd_wait_q.status;
struct cmd_ctrl_node *cmd_queued = adapter->cmd_queued;
struct cmd_ctrl_node *cmd_queued;

if (!adapter->cmd_queued)
return 0;

cmd_queued = adapter->cmd_queued;
adapter->cmd_queued = NULL;

dev_dbg(adapter->dev, "cmd pending\n");
atomic_inc(&adapter->cmd_pending);

Expand Down

0 comments on commit b015dbc

Please sign in to comment.