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