iwlwifi: mvm: make nd_ies part of the mvm struct
authorLuciano Coelho <luciano.coelho@intel.com>
Mon, 10 Nov 2014 21:21:55 +0000 (23:21 +0200)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Sun, 23 Nov 2014 18:08:30 +0000 (20:08 +0200)
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: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/mvm/d3.c
drivers/net/wireless/iwlwifi/mvm/debugfs.c
drivers/net/wireless/iwlwifi/mvm/mvm.h
drivers/net/wireless/iwlwifi/mvm/ops.c

index faa7d5c365d5e8b421d8337f16f66caf82cbc943..0fc72fc6ce2f37b526f698181fb7681787779792 100644 (file)
@@ -1036,7 +1036,7 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw,
                        goto out;
 
                ret = iwl_mvm_scan_offload_start(mvm, vif, mvm->nd_config,
-                                                mvm->nd_ies);
+                                                &mvm->nd_ies);
                if (ret)
                        goto out;
        } else {
index 8212b00096f9188880c228d1f830d98af5a1f01b..5a0f1049e099a6c11e11eee3bce54037bdf4111d 100644 (file)
@@ -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);
                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) +
                                 (11 * sizeof(struct ieee80211_channel *)),
                                 GFP_KERNEL);
@@ -1262,8 +1256,6 @@ out_free:
                kfree(mvm->nd_config->match_sets);
        kfree(mvm->nd_config);
        mvm->nd_config = NULL;
-       kfree(mvm->nd_ies);
-       mvm->nd_ies = NULL;
 out:
        return ret;
 }
index cbfba80a0e2f6879d1a473df531a089cd2971c2f..db52f65e4660248b76f1af9d1c7b256f8f0fa134 100644 (file)
@@ -666,7 +666,7 @@ struct iwl_mvm {
 
        /* sched scan settings for net detect */
        struct cfg80211_sched_scan_request *nd_config;
-       struct ieee80211_scan_ies *nd_ies;
+       struct ieee80211_scan_ies nd_ies;
 #ifdef CONFIG_IWLWIFI_DEBUGFS
        u32 d3_wake_sysassert; /* must be u32 for debugfs_create_bool */
        bool d3_test_active;
index 5ab10fb9d672a166af9cc797a9f16fcf8dd7e6aa..b022fc097e781041ccb2ac5faa9d661da909ef8c 100644 (file)
@@ -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);
                mvm->nd_config = NULL;
-               kfree(mvm->nd_ies);
-               mvm->nd_ies = NULL;
        }
 #endif