aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/tdls.c
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2014-07-17 10:14:18 -0400
committerJohannes Berg <johannes.berg@intel.com>2014-07-21 06:14:03 -0400
commit6ae32e5d284a5db589bfa63561932ad3306f538a (patch)
tree2588c0f8a658032d120d97d0ec8339e411ebe689 /net/mac80211/tdls.c
parent626911cc60d873b38f7ca4c5c537fcb918c658d7 (diff)
mac80211: fix error path for TDLS setup
The patch "8f02e6b mac80211: make sure TDLS peer STA exists during setup" broke TDLS error paths where the STA doesn't exist when sending the error. Fix it by only testing for STA existence during a non-error flow. Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/tdls.c')
-rw-r--r--net/mac80211/tdls.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c
index b01b3104b445..53c235de5d1c 100644
--- a/net/mac80211/tdls.c
+++ b/net/mac80211/tdls.c
@@ -349,15 +349,19 @@ ieee80211_tdls_mgmt_setup(struct wiphy *wiphy, struct net_device *dev,
349 /* 349 /*
350 * make sure we have a STA representing the peer so we drop or buffer 350 * make sure we have a STA representing the peer so we drop or buffer
351 * non-TDLS-setup frames to the peer. We can't send other packets 351 * non-TDLS-setup frames to the peer. We can't send other packets
352 * during setup through the AP path 352 * during setup through the AP path.
353 * Allow error packets to be sent - sometimes we don't even add a STA
354 * before failing the setup.
353 */ 355 */
354 rcu_read_lock(); 356 if (status_code == 0) {
355 if (!sta_info_get(sdata, peer)) { 357 rcu_read_lock();
358 if (!sta_info_get(sdata, peer)) {
359 rcu_read_unlock();
360 ret = -ENOLINK;
361 goto exit;
362 }
356 rcu_read_unlock(); 363 rcu_read_unlock();
357 ret = -ENOLINK;
358 goto exit;
359 } 364 }
360 rcu_read_unlock();
361 365
362 ieee80211_flush_queues(local, sdata); 366 ieee80211_flush_queues(local, sdata);
363 367