aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/wireless/reg.c43
1 files changed, 17 insertions, 26 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 7a2ce270f4d3..e44f0052687c 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -698,34 +698,25 @@ int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by,
698 else if (r) 698 else if (r)
699 return r; 699 return r;
700 700
701 switch (set_by) { 701 request = kzalloc(sizeof(struct regulatory_request),
702 case REGDOM_SET_BY_CORE: 702 GFP_KERNEL);
703 case REGDOM_SET_BY_COUNTRY_IE: 703 if (!request)
704 case REGDOM_SET_BY_DRIVER: 704 return -ENOMEM;
705 case REGDOM_SET_BY_USER: 705
706 request = kzalloc(sizeof(struct regulatory_request), 706 request->alpha2[0] = alpha2[0];
707 GFP_KERNEL); 707 request->alpha2[1] = alpha2[1];
708 if (!request) 708 request->initiator = set_by;
709 return -ENOMEM; 709 request->wiphy = wiphy;
710 710 request->intersect = intersect;
711 request->alpha2[0] = alpha2[0]; 711
712 request->alpha2[1] = alpha2[1]; 712 kfree(last_request);
713 request->initiator = set_by; 713 last_request = request;
714 request->wiphy = wiphy; 714 r = call_crda(alpha2);
715 request->intersect = intersect; 715
716
717 kfree(last_request);
718 last_request = request;
719 r = call_crda(alpha2);
720#ifndef CONFIG_WIRELESS_OLD_REGULATORY 716#ifndef CONFIG_WIRELESS_OLD_REGULATORY
721 if (r) 717 if (r)
722 printk(KERN_ERR "cfg80211: Failed calling CRDA\n"); 718 printk(KERN_ERR "cfg80211: Failed calling CRDA\n");
723#endif 719#endif
724 break;
725 default:
726 r = -ENOTSUPP;
727 break;
728 }
729 720
730 return r; 721 return r;
731} 722}