summaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorJanusz Dziedzic <janusz.dziedzic@tieto.com>2013-12-03 09:50:44 +0100
committerJohannes Berg <johannes.berg@intel.com>2013-12-03 15:19:54 +0100
commit7869303b17a3cc78c9e9f26544be98b5734ac97c (patch)
tree160218d90841ee5d7ede3328be1e0b79c45ba2c3 /net/wireless
parentmac80211: remove duplicate code (diff)
downloadlinux-7869303b17a3cc78c9e9f26544be98b5734ac97c.tar.xz
linux-7869303b17a3cc78c9e9f26544be98b5734ac97c.zip
nl80211: don't clear bitrate_mask twice
Don't clear cfg80211_bitrate_mask twice in nl80211_set_tx_bitrate_mask() function. Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/nl80211.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 9cd8c6113e94..bdcf256e3628 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -7349,15 +7349,14 @@ static int nl80211_set_tx_bitrate_mask(struct sk_buff *skb,
/* Default to all rates enabled */
for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
sband = rdev->wiphy.bands[i];
- mask.control[i].legacy =
- sband ? (1 << sband->n_bitrates) - 1 : 0;
- if (sband)
- memcpy(mask.control[i].mcs,
- sband->ht_cap.mcs.rx_mask,
- sizeof(mask.control[i].mcs));
- else
- memset(mask.control[i].mcs, 0,
- sizeof(mask.control[i].mcs));
+
+ if (!sband)
+ continue;
+
+ mask.control[i].legacy = (1 << sband->n_bitrates) - 1;
+ memcpy(mask.control[i].mcs,
+ sband->ht_cap.mcs.rx_mask,
+ sizeof(mask.control[i].mcs));
}
/*