Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150408
b: refs/heads/master
c: d0e18f8
h: refs/heads/master
v: v3
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed May 20, 2009
1 parent 9efd1ef commit 68ec016
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4776c6e7f66f853011bc1fd6fe37fa63f0b6982c
refs/heads/master: d0e18f833d23afefb6751a21d14a2cd71d2d4d66
19 changes: 13 additions & 6 deletions trunk/net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -2570,15 +2570,19 @@ static int nl80211_set_reg(struct sk_buff *skb, struct genl_info *info)
return -EINVAL;
}

if (!reg_is_valid_request(alpha2))
return -EINVAL;
if (!reg_is_valid_request(alpha2)) {
r = -EINVAL;
goto bad_reg;
}

size_of_regd = sizeof(struct ieee80211_regdomain) +
(num_rules * sizeof(struct ieee80211_reg_rule));

rd = kzalloc(size_of_regd, GFP_KERNEL);
if (!rd)
return -ENOMEM;
if (!rd) {
r = -ENOMEM;
goto bad_reg;
}

rd->n_reg_rules = num_rules;
rd->alpha2[0] = alpha2[0];
Expand All @@ -2595,20 +2599,23 @@ static int nl80211_set_reg(struct sk_buff *skb, struct genl_info *info)

rule_idx++;

if (rule_idx > NL80211_MAX_SUPP_REG_RULES)
if (rule_idx > NL80211_MAX_SUPP_REG_RULES) {
r = -EINVAL;
goto bad_reg;
}
}

BUG_ON(rule_idx != num_rules);

mutex_lock(&cfg80211_mutex);
r = set_regdom(rd);
mutex_unlock(&cfg80211_mutex);

return r;

bad_reg:
kfree(rd);
return -EINVAL;
return r;
}

static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
Expand Down

0 comments on commit 68ec016

Please sign in to comment.