diff options
author | YueHaibing <yuehaibing@huawei.com> | 2018-10-05 09:02:49 +0000 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2019-01-25 20:57:20 +0200 |
commit | af84282e2b48143894383d4d6d7812d72e292be9 (patch) | |
tree | 1cc8df7c8f4e38c9e5c447c25fcbe45667a2b616 | |
parent | e7eed19a28f095d0b5d94992fd6b5d0c5bdbb637 (diff) | |
download | linux-af84282e2b48143894383d4d6d7812d72e292be9.tar.bz2 |
iwlwifi: use kmemdup in iwl_parse_nvm_mcc_info()
Use kmemdup rather than duplicating its implementation in
iwl_parse_nvm_mcc_info().
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c index 173ade96f119..484ef4556953 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c @@ -1195,14 +1195,12 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg, regd_to_copy = sizeof(struct ieee80211_regdomain) + valid_rules * sizeof(struct ieee80211_reg_rule); - copy_rd = kzalloc(regd_to_copy, GFP_KERNEL); + copy_rd = kmemdup(regd, regd_to_copy, GFP_KERNEL); if (!copy_rd) { copy_rd = ERR_PTR(-ENOMEM); goto out; } - memcpy(copy_rd, regd, regd_to_copy); - out: kfree(regdb_ptrs); kfree(regd); |