Skip to content

Commit b015dbc

Browse files
Amitkumar Karwarlinvjw
authored andcommitted
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 <[email protected]> Signed-off-by: Bing Zhao <[email protected]> Signed-off-by: John W. Linville <[email protected]>
1 parent 0900951 commit b015dbc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/net/wireless/mwifiex/sta_ioctl.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,14 @@ int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter)
5555
{
5656
bool cancel_flag = false;
5757
int status = adapter->cmd_wait_q.status;
58-
struct cmd_ctrl_node *cmd_queued = adapter->cmd_queued;
58+
struct cmd_ctrl_node *cmd_queued;
5959

60+
if (!adapter->cmd_queued)
61+
return 0;
62+
63+
cmd_queued = adapter->cmd_queued;
6064
adapter->cmd_queued = NULL;
65+
6166
dev_dbg(adapter->dev, "cmd pending\n");
6267
atomic_inc(&adapter->cmd_pending);
6368

0 commit comments

Comments
 (0)