Blame SOURCES/0083-Revert-iwlwifi-use-kmemdup-in-iwl_parse_nvm_mcc_info.patch

deb259
From a594e9d1d06ddfb6dd3a20a181bf5f0be6481bff Mon Sep 17 00:00:00 2001
deb259
From: Eugene Syromiatnikov <esyr@redhat.com>
deb259
Date: Fri, 6 Sep 2019 01:53:44 +0200
deb259
Subject: [PATCH 6/7] Revert "iwlwifi: use kmemdup in iwl_parse_nvm_mcc_info()"
deb259
deb259
This reverts commit af84282e2b48143894383d4d6d7812d72e292be9.
deb259
---
deb259
 drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 4 +++-
deb259
 1 file changed, 3 insertions(+), 1 deletion(-)
deb259
deb259
Index: src/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
deb259
===================================================================
deb259
--- src.orig/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c	2019-09-06 01:58:30.873997881 +0200
deb259
+++ src/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c	2019-09-06 01:58:31.063995435 +0200
deb259
@@ -982,12 +982,14 @@
deb259
 	regd_to_copy = sizeof(struct ieee80211_regdomain) +
deb259
 		valid_rules * sizeof(struct ieee80211_reg_rule);
deb259
 
deb259
-	copy_rd = kmemdup(regd, regd_to_copy, GFP_KERNEL);
deb259
+	copy_rd = kzalloc(regd_to_copy, GFP_KERNEL);
deb259
 	if (!copy_rd) {
deb259
 		copy_rd = ERR_PTR(-ENOMEM);
deb259
 		goto out;
deb259
 	}
deb259
 
deb259
+	memcpy(copy_rd, regd, regd_to_copy);
deb259
+
deb259
 out:
deb259
 	kfree(regdb_ptrs);
deb259
 	kfree(regd);