aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/reg.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless/reg.c')
-rw-r--r--net/wireless/reg.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 40646e823d5d..62bf212e5648 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -318,8 +318,9 @@ static int reg_copy_regd(const struct ieee80211_regdomain **dst_regd,
318 int size_of_regd = 0; 318 int size_of_regd = 0;
319 unsigned int i; 319 unsigned int i;
320 320
321 size_of_regd = sizeof(struct ieee80211_regdomain) + 321 size_of_regd =
322 ((src_regd->n_reg_rules + 1) * sizeof(struct ieee80211_reg_rule)); 322 sizeof(struct ieee80211_regdomain) +
323 src_regd->n_reg_rules * sizeof(struct ieee80211_reg_rule);
323 324
324 regd = kzalloc(size_of_regd, GFP_KERNEL); 325 regd = kzalloc(size_of_regd, GFP_KERNEL);
325 if (!regd) 326 if (!regd)
@@ -641,7 +642,7 @@ static struct ieee80211_regdomain *regdom_intersect(
641 return NULL; 642 return NULL;
642 643
643 size_of_regd = sizeof(struct ieee80211_regdomain) + 644 size_of_regd = sizeof(struct ieee80211_regdomain) +
644 ((num_rules + 1) * sizeof(struct ieee80211_reg_rule)); 645 num_rules * sizeof(struct ieee80211_reg_rule);
645 646
646 rd = kzalloc(size_of_regd, GFP_KERNEL); 647 rd = kzalloc(size_of_regd, GFP_KERNEL);
647 if (!rd) 648 if (!rd)