diff options
Diffstat (limited to 'net/wireless/core.c')
-rw-r--r-- | net/wireless/core.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c index d52630bbab0..d587ad284b3 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c | |||
@@ -480,12 +480,10 @@ int wiphy_register(struct wiphy *wiphy) | |||
480 | mutex_lock(&cfg80211_mutex); | 480 | mutex_lock(&cfg80211_mutex); |
481 | 481 | ||
482 | res = device_add(&rdev->wiphy.dev); | 482 | res = device_add(&rdev->wiphy.dev); |
483 | if (res) | 483 | if (res) { |
484 | goto out_unlock; | 484 | mutex_unlock(&cfg80211_mutex); |
485 | 485 | return res; | |
486 | res = rfkill_register(rdev->rfkill); | 486 | } |
487 | if (res) | ||
488 | goto out_rm_dev; | ||
489 | 487 | ||
490 | /* set up regulatory info */ | 488 | /* set up regulatory info */ |
491 | wiphy_update_regulatory(wiphy, NL80211_REGDOM_SET_BY_CORE); | 489 | wiphy_update_regulatory(wiphy, NL80211_REGDOM_SET_BY_CORE); |
@@ -514,13 +512,18 @@ int wiphy_register(struct wiphy *wiphy) | |||
514 | cfg80211_debugfs_rdev_add(rdev); | 512 | cfg80211_debugfs_rdev_add(rdev); |
515 | mutex_unlock(&cfg80211_mutex); | 513 | mutex_unlock(&cfg80211_mutex); |
516 | 514 | ||
515 | /* | ||
516 | * due to a locking dependency this has to be outside of the | ||
517 | * cfg80211_mutex lock | ||
518 | */ | ||
519 | res = rfkill_register(rdev->rfkill); | ||
520 | if (res) | ||
521 | goto out_rm_dev; | ||
522 | |||
517 | return 0; | 523 | return 0; |
518 | 524 | ||
519 | out_rm_dev: | 525 | out_rm_dev: |
520 | device_del(&rdev->wiphy.dev); | 526 | device_del(&rdev->wiphy.dev); |
521 | |||
522 | out_unlock: | ||
523 | mutex_unlock(&cfg80211_mutex); | ||
524 | return res; | 527 | return res; |
525 | } | 528 | } |
526 | EXPORT_SYMBOL(wiphy_register); | 529 | EXPORT_SYMBOL(wiphy_register); |