diff options
author | John W. Linville <linville@tuxdriver.com> | 2010-09-24 15:52:34 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-09-24 15:52:34 -0400 |
commit | 29ad2facd47f8e37eab8b156e2c384fa181c8b4a (patch) | |
tree | 25d4df186cd631810ff15a8e7d37cb6cdd806cdb /net/wireless | |
parent | 6e5c2b4e8addfaab8ef54dedaf7b607e1585c35b (diff) | |
parent | cd87a2d3a33d75a646f1aa1aa2ee5bf712d6f963 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
Conflicts:
drivers/net/wireless/ath/ath5k/base.c
net/mac80211/main.c
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/core.c | 21 | ||||
-rw-r--r-- | net/wireless/wext-compat.c | 3 | ||||
-rw-r--r-- | net/wireless/wext-core.c | 16 | ||||
-rw-r--r-- | net/wireless/wext-priv.c | 2 |
4 files changed, 32 insertions, 10 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c index ff9615a7ee7a..9c21ebf9780e 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); |
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index bb5e0a5ecfa1..7e5c3a45f811 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c | |||
@@ -1420,6 +1420,9 @@ int cfg80211_wext_giwessid(struct net_device *dev, | |||
1420 | { | 1420 | { |
1421 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 1421 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
1422 | 1422 | ||
1423 | data->flags = 0; | ||
1424 | data->length = 0; | ||
1425 | |||
1423 | switch (wdev->iftype) { | 1426 | switch (wdev->iftype) { |
1424 | case NL80211_IFTYPE_ADHOC: | 1427 | case NL80211_IFTYPE_ADHOC: |
1425 | return cfg80211_ibss_wext_giwessid(dev, info, data, ssid); | 1428 | return cfg80211_ibss_wext_giwessid(dev, info, data, ssid); |
diff --git a/net/wireless/wext-core.c b/net/wireless/wext-core.c index 40385936e286..dc675a3daa3d 100644 --- a/net/wireless/wext-core.c +++ b/net/wireless/wext-core.c | |||
@@ -782,6 +782,22 @@ static int ioctl_standard_iw_point(struct iw_point *iwp, unsigned int cmd, | |||
782 | } | 782 | } |
783 | } | 783 | } |
784 | 784 | ||
785 | if (IW_IS_GET(cmd) && !(descr->flags & IW_DESCR_FLAG_NOMAX)) { | ||
786 | /* | ||
787 | * If this is a GET, but not NOMAX, it means that the extra | ||
788 | * data is not bounded by userspace, but by max_tokens. Thus | ||
789 | * set the length to max_tokens. This matches the extra data | ||
790 | * allocation. | ||
791 | * The driver should fill it with the number of tokens it | ||
792 | * provided, and it may check iwp->length rather than having | ||
793 | * knowledge of max_tokens. If the driver doesn't change the | ||
794 | * iwp->length, this ioctl just copies back max_token tokens | ||
795 | * filled with zeroes. Hopefully the driver isn't claiming | ||
796 | * them to be valid data. | ||
797 | */ | ||
798 | iwp->length = descr->max_tokens; | ||
799 | } | ||
800 | |||
785 | err = handler(dev, info, (union iwreq_data *) iwp, extra); | 801 | err = handler(dev, info, (union iwreq_data *) iwp, extra); |
786 | 802 | ||
787 | iwp->length += essid_compat; | 803 | iwp->length += essid_compat; |
diff --git a/net/wireless/wext-priv.c b/net/wireless/wext-priv.c index 3feb28e41c53..674d426a9d24 100644 --- a/net/wireless/wext-priv.c +++ b/net/wireless/wext-priv.c | |||
@@ -152,7 +152,7 @@ static int ioctl_private_iw_point(struct iw_point *iwp, unsigned int cmd, | |||
152 | } else if (!iwp->pointer) | 152 | } else if (!iwp->pointer) |
153 | return -EFAULT; | 153 | return -EFAULT; |
154 | 154 | ||
155 | extra = kmalloc(extra_size, GFP_KERNEL); | 155 | extra = kzalloc(extra_size, GFP_KERNEL); |
156 | if (!extra) | 156 | if (!extra) |
157 | return -ENOMEM; | 157 | return -ENOMEM; |
158 | 158 | ||