module_param(ieee80211_regdom, charp, 0444);
MODULE_PARM_DESC(ieee80211_regdom, "IEEE 802.11 regulatory domain code");
+static void reg_kfree_last_request(void)
+{
+ struct regulatory_request *lr;
+
+ lr = get_last_request();
+
+ if (lr != &core_request_world && lr)
+ kfree_rcu(lr, rcu_head);
+}
+
static void reset_regdomains(bool full_reset,
const struct ieee80211_regdomain *new_regdom)
{
const struct ieee80211_regdomain *r;
- struct regulatory_request *lr;
ASSERT_RTNL();
if (!full_reset)
return;
- lr = get_last_request();
- if (lr != &core_request_world && lr)
- kfree_rcu(lr, rcu_head);
+ reg_kfree_last_request();
rcu_assign_pointer(last_request, &core_request_world);
}
static enum reg_request_treatment
reg_process_hint_core(struct regulatory_request *core_request)
{
- struct regulatory_request *lr;
-
- lr = get_last_request();
- if (lr != &core_request_world && lr)
- kfree_rcu(lr, rcu_head);
core_request->intersect = false;
core_request->processed = false;
+
+ reg_kfree_last_request();
rcu_assign_pointer(last_request, core_request);
if (call_crda(core_request->alpha2))
reg_process_hint_user(struct regulatory_request *user_request)
{
enum reg_request_treatment treatment;
- struct regulatory_request *lr;
treatment = __reg_process_hint_user(user_request);
if (treatment == REG_REQ_IGNORE ||
return treatment;
}
- lr = get_last_request();
- if (lr != &core_request_world && lr)
- kfree_rcu(lr, rcu_head);
-
user_request->intersect = treatment == REG_REQ_INTERSECT;
user_request->processed = false;
+
+ reg_kfree_last_request();
rcu_assign_pointer(last_request, user_request);
user_alpha2[0] = user_request->alpha2[0];
{
const struct ieee80211_regdomain *regd;
enum reg_request_treatment treatment;
- struct regulatory_request *lr;
treatment = __reg_process_hint_driver(driver_request);
rcu_assign_pointer(wiphy->regd, regd);
}
- lr = get_last_request();
- if (lr != &core_request_world && lr)
- kfree_rcu(lr, rcu_head);
driver_request->intersect = treatment == REG_REQ_INTERSECT;
driver_request->processed = false;
+
+ reg_kfree_last_request();
rcu_assign_pointer(last_request, driver_request);
/*
struct regulatory_request *country_ie_request)
{
enum reg_request_treatment treatment;
- struct regulatory_request *lr;
treatment = __reg_process_hint_country_ie(wiphy, country_ie_request);
return REG_REQ_IGNORE;
}
- lr = get_last_request();
- if (lr != &core_request_world && lr)
- kfree_rcu(lr, rcu_head);
-
country_ie_request->intersect = false;
country_ie_request->processed = false;
+
+ reg_kfree_last_request();
rcu_assign_pointer(last_request, country_ie_request);
if (call_crda(country_ie_request->alpha2))