mirror of
https://github.com/torvalds/linux.git
synced 2024-12-26 12:52:30 +00:00
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>
This commit is contained in:
parent
e7eed19a28
commit
af84282e2b
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user