diff options
author | Avinash Patil <patila@marvell.com> | 2015-02-06 09:28:05 -0500 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-02-26 08:05:30 -0500 |
commit | ffdcad05968ccb9ca2bb66f0e72467aa87baf2c2 (patch) | |
tree | 2b3f4f9f3ba9a2826a8e69b338e658f59990981f /drivers/net/wireless/mwifiex | |
parent | 01317c264166babe695174aa0d9e6cd93055df1a (diff) |
mwifiex: use alloc_workqueue's format strings capabilities for WQ names
alloc_workqueue() has string format formation ability e.g. wqname%ifname
will be treated as wqnameifname. Use this and remove string operations
while defining strings for workqueue names.
Reported-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/mwifiex')
-rw-r--r-- | drivers/net/wireless/mwifiex/cfg80211.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index 41c8e25df954..5f3c1d3c52e0 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -2397,7 +2397,6 @@ mwifiex_setup_ht_caps(struct ieee80211_sta_ht_cap *ht_info, | |||
2397 | ht_info->mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED; | 2397 | ht_info->mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED; |
2398 | } | 2398 | } |
2399 | 2399 | ||
2400 | #define MWIFIEX_MAX_WQ_LEN 30 | ||
2401 | /* | 2400 | /* |
2402 | * create a new virtual interface with the given name | 2401 | * create a new virtual interface with the given name |
2403 | */ | 2402 | */ |
@@ -2411,7 +2410,6 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
2411 | struct mwifiex_private *priv; | 2410 | struct mwifiex_private *priv; |
2412 | struct net_device *dev; | 2411 | struct net_device *dev; |
2413 | void *mdev_priv; | 2412 | void *mdev_priv; |
2414 | char dfs_cac_str[MWIFIEX_MAX_WQ_LEN], dfs_chsw_str[MWIFIEX_MAX_WQ_LEN]; | ||
2415 | 2413 | ||
2416 | if (!adapter) | 2414 | if (!adapter) |
2417 | return ERR_PTR(-EFAULT); | 2415 | return ERR_PTR(-EFAULT); |
@@ -2576,12 +2574,10 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
2576 | return ERR_PTR(-EFAULT); | 2574 | return ERR_PTR(-EFAULT); |
2577 | } | 2575 | } |
2578 | 2576 | ||
2579 | strcpy(dfs_cac_str, "MWIFIEX_DFS_CAC"); | 2577 | priv->dfs_cac_workqueue = alloc_workqueue("MWIFIEX_DFS_CAC%s", |
2580 | strcat(dfs_cac_str, name); | ||
2581 | priv->dfs_cac_workqueue = alloc_workqueue(dfs_cac_str, | ||
2582 | WQ_HIGHPRI | | 2578 | WQ_HIGHPRI | |
2583 | WQ_MEM_RECLAIM | | 2579 | WQ_MEM_RECLAIM | |
2584 | WQ_UNBOUND, 1); | 2580 | WQ_UNBOUND, 1, name); |
2585 | if (!priv->dfs_cac_workqueue) { | 2581 | if (!priv->dfs_cac_workqueue) { |
2586 | wiphy_err(wiphy, "cannot register virtual network device\n"); | 2582 | wiphy_err(wiphy, "cannot register virtual network device\n"); |
2587 | free_netdev(dev); | 2583 | free_netdev(dev); |
@@ -2594,11 +2590,9 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
2594 | 2590 | ||
2595 | INIT_DELAYED_WORK(&priv->dfs_cac_work, mwifiex_dfs_cac_work_queue); | 2591 | INIT_DELAYED_WORK(&priv->dfs_cac_work, mwifiex_dfs_cac_work_queue); |
2596 | 2592 | ||
2597 | strcpy(dfs_chsw_str, "MWIFIEX_DFS_CHSW"); | 2593 | priv->dfs_chan_sw_workqueue = alloc_workqueue("MWIFIEX_DFS_CHSW%s", |
2598 | strcat(dfs_chsw_str, name); | ||
2599 | priv->dfs_chan_sw_workqueue = alloc_workqueue(dfs_chsw_str, | ||
2600 | WQ_HIGHPRI | WQ_UNBOUND | | 2594 | WQ_HIGHPRI | WQ_UNBOUND | |
2601 | WQ_MEM_RECLAIM, 1); | 2595 | WQ_MEM_RECLAIM, 1, name); |
2602 | if (!priv->dfs_chan_sw_workqueue) { | 2596 | if (!priv->dfs_chan_sw_workqueue) { |
2603 | wiphy_err(wiphy, "cannot register virtual network device\n"); | 2597 | wiphy_err(wiphy, "cannot register virtual network device\n"); |
2604 | free_netdev(dev); | 2598 | free_netdev(dev); |