diff options
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r-- | net/wireless/nl80211.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 8808431bd581..353e1a4ece83 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -366,16 +366,26 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info) | |||
366 | int result = 0, rem_txq_params = 0; | 366 | int result = 0, rem_txq_params = 0; |
367 | struct nlattr *nl_txq_params; | 367 | struct nlattr *nl_txq_params; |
368 | 368 | ||
369 | rdev = cfg80211_get_dev_from_info(info); | 369 | rtnl_lock(); |
370 | if (IS_ERR(rdev)) | 370 | |
371 | return PTR_ERR(rdev); | 371 | mutex_lock(&cfg80211_mutex); |
372 | |||
373 | rdev = __cfg80211_drv_from_info(info); | ||
374 | if (IS_ERR(rdev)) { | ||
375 | result = PTR_ERR(rdev); | ||
376 | goto unlock; | ||
377 | } | ||
372 | 378 | ||
373 | if (info->attrs[NL80211_ATTR_WIPHY_NAME]) { | 379 | mutex_lock(&rdev->mtx); |
380 | |||
381 | if (info->attrs[NL80211_ATTR_WIPHY_NAME]) | ||
374 | result = cfg80211_dev_rename( | 382 | result = cfg80211_dev_rename( |
375 | rdev, nla_data(info->attrs[NL80211_ATTR_WIPHY_NAME])); | 383 | rdev, nla_data(info->attrs[NL80211_ATTR_WIPHY_NAME])); |
376 | if (result) | 384 | |
377 | goto bad_res; | 385 | mutex_unlock(&cfg80211_mutex); |
378 | } | 386 | |
387 | if (result) | ||
388 | goto bad_res; | ||
379 | 389 | ||
380 | if (info->attrs[NL80211_ATTR_WIPHY_TXQ_PARAMS]) { | 390 | if (info->attrs[NL80211_ATTR_WIPHY_TXQ_PARAMS]) { |
381 | struct ieee80211_txq_params txq_params; | 391 | struct ieee80211_txq_params txq_params; |
@@ -471,7 +481,9 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info) | |||
471 | 481 | ||
472 | 482 | ||
473 | bad_res: | 483 | bad_res: |
474 | cfg80211_put_dev(rdev); | 484 | mutex_unlock(&rdev->mtx); |
485 | unlock: | ||
486 | rtnl_unlock(); | ||
475 | return result; | 487 | return result; |
476 | } | 488 | } |
477 | 489 | ||