aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/scan.c
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2012-10-05 23:21:41 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-10-08 15:06:03 -0400
commit061f2e69fedbcd7839c8e6e6b659e345acc3396f (patch)
tree83e0485a16c54622aa3c1ce1c3cc04b7e9b4eb8e /drivers/net/wireless/mwifiex/scan.c
parentc2476335313e618c0368ffbe73e05bba4d0f5f89 (diff)
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: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/scan.c')
-rw-r--r--drivers/net/wireless/mwifiex/scan.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
index bfb90a55117a..d9295fd8e427 100644
--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -1327,7 +1327,8 @@ int mwifiex_scan_networks(struct mwifiex_private *priv,
1327 GFP_KERNEL); 1327 GFP_KERNEL);
1328 if (!scan_cfg_out) { 1328 if (!scan_cfg_out) {
1329 dev_err(adapter->dev, "failed to alloc scan_cfg_out\n"); 1329 dev_err(adapter->dev, "failed to alloc scan_cfg_out\n");
1330 return -ENOMEM; 1330 ret = -ENOMEM;
1331 goto done;
1331 } 1332 }
1332 1333
1333 buf_size = sizeof(struct mwifiex_chan_scan_param_set) * 1334 buf_size = sizeof(struct mwifiex_chan_scan_param_set) *
@@ -1336,7 +1337,8 @@ int mwifiex_scan_networks(struct mwifiex_private *priv,
1336 if (!scan_chan_list) { 1337 if (!scan_chan_list) {
1337 dev_err(adapter->dev, "failed to alloc scan_chan_list\n"); 1338 dev_err(adapter->dev, "failed to alloc scan_chan_list\n");
1338 kfree(scan_cfg_out); 1339 kfree(scan_cfg_out);
1339 return -ENOMEM; 1340 ret = -ENOMEM;
1341 goto done;
1340 } 1342 }
1341 1343
1342 mwifiex_config_scan(priv, user_scan_in, &scan_cfg_out->config, 1344 mwifiex_config_scan(priv, user_scan_in, &scan_cfg_out->config,
@@ -1364,14 +1366,16 @@ int mwifiex_scan_networks(struct mwifiex_private *priv,
1364 spin_unlock_irqrestore(&adapter->scan_pending_q_lock, 1366 spin_unlock_irqrestore(&adapter->scan_pending_q_lock,
1365 flags); 1367 flags);
1366 } 1368 }
1367 } else {
1368 spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
1369 adapter->scan_processing = true;
1370 spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
1371 } 1369 }
1372 1370
1373 kfree(scan_cfg_out); 1371 kfree(scan_cfg_out);
1374 kfree(scan_chan_list); 1372 kfree(scan_chan_list);
1373done:
1374 if (ret) {
1375 spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
1376 adapter->scan_processing = false;
1377 spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
1378 }
1375 return ret; 1379 return ret;
1376} 1380}
1377 1381