aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-02-05 10:51:29 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-02-11 12:44:58 -0500
commit83c7aa1a1475ae1c42640ab6e4559016142efc67 (patch)
tree1a93edf5cb47eea45a120bd34ab0c72383cb28b6
parentb207cdb07f3f01ec1adaac62e9d0cc918c60a81a (diff)
cfg80211: remove scan ies NULL check
There's no way scan BSS IEs can be NULL as even if the allocation fails the frame is discarded. Remove some code checking for this and document that it is always non-NULL. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--drivers/net/wireless/mwifiex/sta_ioctl.c5
-rw-r--r--include/net/cfg80211.h8
-rw-r--r--net/wireless/scan.c11
3 files changed, 7 insertions, 17 deletions
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index ee85b41a4dfd..8866a2b69c94 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -162,11 +162,6 @@ int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv,
162 162
163 rcu_read_lock(); 163 rcu_read_lock();
164 ies = rcu_dereference(bss->ies); 164 ies = rcu_dereference(bss->ies);
165 if (WARN_ON(!ies)) {
166 /* should never happen */
167 rcu_read_unlock();
168 return -EINVAL;
169 }
170 beacon_ie = kmemdup(ies->data, ies->len, GFP_ATOMIC); 165 beacon_ie = kmemdup(ies->data, ies->len, GFP_ATOMIC);
171 beacon_ie_len = ies->len; 166 beacon_ie_len = ies->len;
172 rcu_read_unlock(); 167 rcu_read_unlock();
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 04a702d1f2a5..fb766314b3a1 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1287,10 +1287,10 @@ struct cfg80211_bss_ies {
1287 * @tsf: timestamp of last received update 1287 * @tsf: timestamp of last received update
1288 * @beacon_interval: the beacon interval as from the frame 1288 * @beacon_interval: the beacon interval as from the frame
1289 * @capability: the capability field in host byte order 1289 * @capability: the capability field in host byte order
1290 * @ies: the information elements (Note that there 1290 * @ies: the information elements (Note that there is no guarantee that these
1291 * is no guarantee that these are well-formed!); this is a pointer to 1291 * are well-formed!); this is a pointer to either the beacon_ies or
1292 * either the beacon_ies or proberesp_ies depending on whether Probe 1292 * proberesp_ies depending on whether Probe Response frame has been
1293 * Response frame has been received 1293 * received. It is always non-%NULL.
1294 * @beacon_ies: the information elements from the last Beacon frame 1294 * @beacon_ies: the information elements from the last Beacon frame
1295 * (implementation note: if @hidden_beacon_bss is set this struct doesn't 1295 * (implementation note: if @hidden_beacon_bss is set this struct doesn't
1296 * own the beacon_ies, but they're just pointers to the ones from the 1296 * own the beacon_ies, but they're just pointers to the ones from the
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 5e0983d60428..02a238329c83 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -1293,15 +1293,10 @@ ieee80211_bss(struct wiphy *wiphy, struct iw_request_info *info,
1293 1293
1294 rcu_read_lock(); 1294 rcu_read_lock();
1295 ies = rcu_dereference(bss->pub.ies); 1295 ies = rcu_dereference(bss->pub.ies);
1296 if (ies) { 1296 rem = ies->len;
1297 rem = ies->len; 1297 ie = ies->data;
1298 ie = ies->data;
1299 } else {
1300 rem = 0;
1301 ie = NULL;
1302 }
1303 1298
1304 while (ies && rem >= 2) { 1299 while (rem >= 2) {
1305 /* invalid data */ 1300 /* invalid data */
1306 if (ie[1] > rem - 2) 1301 if (ie[1] > rem - 2)
1307 break; 1302 break;