Commit cc4c1ab5 authored by Luciano Coelho's avatar Luciano Coelho Committed by Emmanuel Grumbach

iwlwifi: mvm: make nd_ies part of the mvm struct

Instead of allocating nd_ies separately, make it part of the iwl_mvm
structure so it's easier to handle its lifetime.
Signed-off-by: default avatarLuciano Coelho <luciano.coelho@intel.com>
Reviewed-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent 522713c8
...@@ -1036,7 +1036,7 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw, ...@@ -1036,7 +1036,7 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw,
goto out; goto out;
ret = iwl_mvm_scan_offload_start(mvm, vif, mvm->nd_config, ret = iwl_mvm_scan_offload_start(mvm, vif, mvm->nd_config,
mvm->nd_ies); &mvm->nd_ies);
if (ret) if (ret)
goto out; goto out;
} else { } else {
......
...@@ -1198,14 +1198,8 @@ static ssize_t iwl_dbgfs_netdetect_write(struct iwl_mvm *mvm, char *buf, ...@@ -1198,14 +1198,8 @@ static ssize_t iwl_dbgfs_netdetect_write(struct iwl_mvm *mvm, char *buf,
kfree(mvm->nd_config->match_sets); kfree(mvm->nd_config->match_sets);
kfree(mvm->nd_config); kfree(mvm->nd_config);
mvm->nd_config = NULL; mvm->nd_config = NULL;
kfree(mvm->nd_ies);
mvm->nd_ies = NULL;
} }
mvm->nd_ies = kzalloc(sizeof(*mvm->nd_ies), GFP_KERNEL);
if (!mvm->nd_ies)
return -ENOMEM;
mvm->nd_config = kzalloc(sizeof(*mvm->nd_config) + mvm->nd_config = kzalloc(sizeof(*mvm->nd_config) +
(11 * sizeof(struct ieee80211_channel *)), (11 * sizeof(struct ieee80211_channel *)),
GFP_KERNEL); GFP_KERNEL);
...@@ -1262,8 +1256,6 @@ static ssize_t iwl_dbgfs_netdetect_write(struct iwl_mvm *mvm, char *buf, ...@@ -1262,8 +1256,6 @@ static ssize_t iwl_dbgfs_netdetect_write(struct iwl_mvm *mvm, char *buf,
kfree(mvm->nd_config->match_sets); kfree(mvm->nd_config->match_sets);
kfree(mvm->nd_config); kfree(mvm->nd_config);
mvm->nd_config = NULL; mvm->nd_config = NULL;
kfree(mvm->nd_ies);
mvm->nd_ies = NULL;
out: out:
return ret; return ret;
} }
......
...@@ -666,7 +666,7 @@ struct iwl_mvm { ...@@ -666,7 +666,7 @@ struct iwl_mvm {
/* sched scan settings for net detect */ /* sched scan settings for net detect */
struct cfg80211_sched_scan_request *nd_config; struct cfg80211_sched_scan_request *nd_config;
struct ieee80211_scan_ies *nd_ies; struct ieee80211_scan_ies nd_ies;
#ifdef CONFIG_IWLWIFI_DEBUGFS #ifdef CONFIG_IWLWIFI_DEBUGFS
u32 d3_wake_sysassert; /* must be u32 for debugfs_create_bool */ u32 d3_wake_sysassert; /* must be u32 for debugfs_create_bool */
bool d3_test_active; bool d3_test_active;
......
...@@ -597,8 +597,6 @@ static void iwl_op_mode_mvm_stop(struct iwl_op_mode *op_mode) ...@@ -597,8 +597,6 @@ static void iwl_op_mode_mvm_stop(struct iwl_op_mode *op_mode)
kfree(mvm->nd_config->match_sets); kfree(mvm->nd_config->match_sets);
kfree(mvm->nd_config); kfree(mvm->nd_config);
mvm->nd_config = NULL; mvm->nd_config = NULL;
kfree(mvm->nd_ies);
mvm->nd_ies = NULL;
} }
#endif #endif
......
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