Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af84282e authored by YueHaibing's avatar YueHaibing Committed by Luca Coelho
Browse files

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: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent e7eed19a
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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);