diff options
Diffstat (limited to 'net/wireless/wext-compat.c')
| -rw-r--r-- | net/wireless/wext-compat.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index 167f7025ac98..06943d9c9835 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c | |||
| @@ -1278,12 +1278,16 @@ static int cfg80211_wext_giwrate(struct net_device *dev, | |||
| 1278 | if (err) | 1278 | if (err) |
| 1279 | return err; | 1279 | return err; |
| 1280 | 1280 | ||
| 1281 | if (!(sinfo.filled & BIT_ULL(NL80211_STA_INFO_TX_BITRATE))) | 1281 | if (!(sinfo.filled & BIT_ULL(NL80211_STA_INFO_TX_BITRATE))) { |
| 1282 | return -EOPNOTSUPP; | 1282 | err = -EOPNOTSUPP; |
| 1283 | goto free; | ||
| 1284 | } | ||
| 1283 | 1285 | ||
| 1284 | rate->value = 100000 * cfg80211_calculate_bitrate(&sinfo.txrate); | 1286 | rate->value = 100000 * cfg80211_calculate_bitrate(&sinfo.txrate); |
| 1285 | 1287 | ||
| 1286 | return 0; | 1288 | free: |
| 1289 | cfg80211_sinfo_release_content(&sinfo); | ||
| 1290 | return err; | ||
| 1287 | } | 1291 | } |
| 1288 | 1292 | ||
| 1289 | /* Get wireless statistics. Called by /proc/net/wireless and by SIOCGIWSTATS */ | 1293 | /* Get wireless statistics. Called by /proc/net/wireless and by SIOCGIWSTATS */ |
| @@ -1293,7 +1297,7 @@ static struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev) | |||
| 1293 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); | 1297 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
| 1294 | /* we are under RTNL - globally locked - so can use static structs */ | 1298 | /* we are under RTNL - globally locked - so can use static structs */ |
| 1295 | static struct iw_statistics wstats; | 1299 | static struct iw_statistics wstats; |
| 1296 | static struct station_info sinfo; | 1300 | static struct station_info sinfo = {}; |
| 1297 | u8 bssid[ETH_ALEN]; | 1301 | u8 bssid[ETH_ALEN]; |
| 1298 | 1302 | ||
| 1299 | if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_STATION) | 1303 | if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_STATION) |
| @@ -1352,6 +1356,8 @@ static struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev) | |||
| 1352 | if (sinfo.filled & BIT_ULL(NL80211_STA_INFO_TX_FAILED)) | 1356 | if (sinfo.filled & BIT_ULL(NL80211_STA_INFO_TX_FAILED)) |
| 1353 | wstats.discard.retries = sinfo.tx_failed; | 1357 | wstats.discard.retries = sinfo.tx_failed; |
| 1354 | 1358 | ||
| 1359 | cfg80211_sinfo_release_content(&sinfo); | ||
| 1360 | |||
| 1355 | return &wstats; | 1361 | return &wstats; |
| 1356 | } | 1362 | } |
| 1357 | 1363 | ||
