diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-10-24 20:32:20 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-10-31 19:02:30 -0400 |
commit | d2372b315289aec9f565a855023c40654a5bff68 (patch) | |
tree | cfc73e74dfdea854dd27b747d68224076d8e8d90 /Documentation | |
parent | 7dddaf1a36a372c14ca96a0b5fdfbe2015c43841 (diff) |
wireless: make regdom passing semantics simpler
The regdom struct is given to the core, so it might as well
free it in error conditions.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/networking/regulatory.txt | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/Documentation/networking/regulatory.txt b/Documentation/networking/regulatory.txt index a96989a8ff3..357d4ba4f13 100644 --- a/Documentation/networking/regulatory.txt +++ b/Documentation/networking/regulatory.txt @@ -167,7 +167,6 @@ struct ieee80211_regdomain mydriver_jp_regdom = { Then in some part of your code after your wiphy has been registered: - int r; struct ieee80211_regdomain *rd; int size_of_regd; int num_rules = mydriver_jp_regdom.n_reg_rules; @@ -178,17 +177,11 @@ Then in some part of your code after your wiphy has been registered: rd = kzalloc(size_of_regd, GFP_KERNEL); if (!rd) - return -ENOMEM; + return -ENOMEM; memcpy(rd, &mydriver_jp_regdom, sizeof(struct ieee80211_regdomain)); - for (i=0; i < num_rules; i++) { + for (i=0; i < num_rules; i++) memcpy(&rd->reg_rules[i], &mydriver_jp_regdom.reg_rules[i], sizeof(struct ieee80211_reg_rule)); - } - r = regulatory_hint(hw->wiphy, NULL, rd); - if (r) { - kfree(rd); - return r; - } - + return regulatory_hint(hw->wiphy, NULL, rd); |