aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/wireless/reg.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index ed89c59bb431..81fcafc60150 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -324,7 +324,7 @@ struct reg_regdb_search_request {
324}; 324};
325 325
326static LIST_HEAD(reg_regdb_search_list); 326static LIST_HEAD(reg_regdb_search_list);
327static DEFINE_SPINLOCK(reg_regdb_search_lock); 327static DEFINE_MUTEX(reg_regdb_search_mutex);
328 328
329static void reg_regdb_search(struct work_struct *work) 329static void reg_regdb_search(struct work_struct *work)
330{ 330{
@@ -332,7 +332,7 @@ static void reg_regdb_search(struct work_struct *work)
332 const struct ieee80211_regdomain *curdom, *regdom; 332 const struct ieee80211_regdomain *curdom, *regdom;
333 int i, r; 333 int i, r;
334 334
335 spin_lock(&reg_regdb_search_lock); 335 mutex_lock(&reg_regdb_search_mutex);
336 while (!list_empty(&reg_regdb_search_list)) { 336 while (!list_empty(&reg_regdb_search_list)) {
337 request = list_first_entry(&reg_regdb_search_list, 337 request = list_first_entry(&reg_regdb_search_list,
338 struct reg_regdb_search_request, 338 struct reg_regdb_search_request,
@@ -346,18 +346,16 @@ static void reg_regdb_search(struct work_struct *work)
346 r = reg_copy_regd(&regdom, curdom); 346 r = reg_copy_regd(&regdom, curdom);
347 if (r) 347 if (r)
348 break; 348 break;
349 spin_unlock(&reg_regdb_search_lock);
350 mutex_lock(&cfg80211_mutex); 349 mutex_lock(&cfg80211_mutex);
351 set_regdom(regdom); 350 set_regdom(regdom);
352 mutex_unlock(&cfg80211_mutex); 351 mutex_unlock(&cfg80211_mutex);
353 spin_lock(&reg_regdb_search_lock);
354 break; 352 break;
355 } 353 }
356 } 354 }
357 355
358 kfree(request); 356 kfree(request);
359 } 357 }
360 spin_unlock(&reg_regdb_search_lock); 358 mutex_unlock(&reg_regdb_search_mutex);
361} 359}
362 360
363static DECLARE_WORK(reg_regdb_work, reg_regdb_search); 361static DECLARE_WORK(reg_regdb_work, reg_regdb_search);
@@ -375,9 +373,9 @@ static void reg_regdb_query(const char *alpha2)
375 373
376 memcpy(request->alpha2, alpha2, 2); 374 memcpy(request->alpha2, alpha2, 2);
377 375
378 spin_lock(&reg_regdb_search_lock); 376 mutex_lock(&reg_regdb_search_mutex);
379 list_add_tail(&request->list, &reg_regdb_search_list); 377 list_add_tail(&request->list, &reg_regdb_search_list);
380 spin_unlock(&reg_regdb_search_lock); 378 mutex_unlock(&reg_regdb_search_mutex);
381 379
382 schedule_work(&reg_regdb_work); 380 schedule_work(&reg_regdb_work);
383} 381}