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.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index b95e9cf139c0..d944c25f1bb1 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -240,19 +240,21 @@ static char user_alpha2[2];
240module_param(ieee80211_regdom, charp, 0444); 240module_param(ieee80211_regdom, charp, 0444);
241MODULE_PARM_DESC(ieee80211_regdom, "IEEE 802.11 regulatory domain code"); 241MODULE_PARM_DESC(ieee80211_regdom, "IEEE 802.11 regulatory domain code");
242 242
243static void reg_kfree_last_request(void) 243static void reg_free_request(struct regulatory_request *lr)
244{ 244{
245 struct regulatory_request *lr;
246
247 lr = get_last_request();
248
249 if (lr != &core_request_world && lr) 245 if (lr != &core_request_world && lr)
250 kfree_rcu(lr, rcu_head); 246 kfree_rcu(lr, rcu_head);
251} 247}
252 248
253static void reg_update_last_request(struct regulatory_request *request) 249static void reg_update_last_request(struct regulatory_request *request)
254{ 250{
255 reg_kfree_last_request(); 251 struct regulatory_request *lr;
252
253 lr = get_last_request();
254 if (lr == request)
255 return;
256
257 reg_free_request(lr);
256 rcu_assign_pointer(last_request, request); 258 rcu_assign_pointer(last_request, request);
257} 259}
258 260