Commit 061f2e69 authored by Amitkumar Karwar's avatar Amitkumar Karwar Committed by John W. Linville

mwifiex: reset scan_processing flag in failure cases

scan_processing flag should be reset when scan request is failed
due to some reasons Ex. memory allocation failure etc. Otherwise
further scan requests will be blocked.
Signed-off-by: default avatarAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent c2476335
...@@ -1327,7 +1327,8 @@ int mwifiex_scan_networks(struct mwifiex_private *priv, ...@@ -1327,7 +1327,8 @@ int mwifiex_scan_networks(struct mwifiex_private *priv,
GFP_KERNEL); GFP_KERNEL);
if (!scan_cfg_out) { if (!scan_cfg_out) {
dev_err(adapter->dev, "failed to alloc scan_cfg_out\n"); dev_err(adapter->dev, "failed to alloc scan_cfg_out\n");
return -ENOMEM; ret = -ENOMEM;
goto done;
} }
buf_size = sizeof(struct mwifiex_chan_scan_param_set) * buf_size = sizeof(struct mwifiex_chan_scan_param_set) *
...@@ -1336,7 +1337,8 @@ int mwifiex_scan_networks(struct mwifiex_private *priv, ...@@ -1336,7 +1337,8 @@ int mwifiex_scan_networks(struct mwifiex_private *priv,
if (!scan_chan_list) { if (!scan_chan_list) {
dev_err(adapter->dev, "failed to alloc scan_chan_list\n"); dev_err(adapter->dev, "failed to alloc scan_chan_list\n");
kfree(scan_cfg_out); kfree(scan_cfg_out);
return -ENOMEM; ret = -ENOMEM;
goto done;
} }
mwifiex_config_scan(priv, user_scan_in, &scan_cfg_out->config, mwifiex_config_scan(priv, user_scan_in, &scan_cfg_out->config,
...@@ -1364,14 +1366,16 @@ int mwifiex_scan_networks(struct mwifiex_private *priv, ...@@ -1364,14 +1366,16 @@ int mwifiex_scan_networks(struct mwifiex_private *priv,
spin_unlock_irqrestore(&adapter->scan_pending_q_lock, spin_unlock_irqrestore(&adapter->scan_pending_q_lock,
flags); flags);
} }
} else {
spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
adapter->scan_processing = true;
spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
} }
kfree(scan_cfg_out); kfree(scan_cfg_out);
kfree(scan_chan_list); kfree(scan_chan_list);
done:
if (ret) {
spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
adapter->scan_processing = false;
spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
}
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment