diff options
author | Johannes Berg <johannes.berg@intel.com> | 2011-05-13 08:15:49 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-05-16 14:10:41 -0400 |
commit | 40b275b69ee660274b77fb612b0db31fd282fc3f (patch) | |
tree | 29a4f82a44a12edcf9db5de6a3c6df9615a5799e /net/mac80211/cfg.c | |
parent | ec034b208dc8aa5dc73ec46c3f27e34c5efbf113 (diff) |
mac80211: sparse RCU annotations
This adds sparse RCU annotations to most of
mac80211, only the mesh code remains to be
done.
Due the the previous patches, the annotations
are pretty simple. The only thing that this
actually changes is removing the RCU usage of
key->sta in debugfs since this pointer isn't
actually an RCU-managed pointer (it only has
a single assignment done before the key even
goes live). As that is otherwise harmless, I
decided to make it part of this patch.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r-- | net/mac80211/cfg.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 2d1c1a5f3c51..6ecd5862735d 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -177,11 +177,11 @@ static int ieee80211_del_key(struct wiphy *wiphy, struct net_device *dev, | |||
177 | goto out_unlock; | 177 | goto out_unlock; |
178 | 178 | ||
179 | if (pairwise) | 179 | if (pairwise) |
180 | key = sta->ptk; | 180 | key = key_mtx_dereference(local, sta->ptk); |
181 | else | 181 | else |
182 | key = sta->gtk[key_idx]; | 182 | key = key_mtx_dereference(local, sta->gtk[key_idx]); |
183 | } else | 183 | } else |
184 | key = sdata->keys[key_idx]; | 184 | key = key_mtx_dereference(local, sdata->keys[key_idx]); |
185 | 185 | ||
186 | if (!key) { | 186 | if (!key) { |
187 | ret = -ENOENT; | 187 | ret = -ENOENT; |
@@ -463,7 +463,7 @@ static int ieee80211_config_beacon(struct ieee80211_sub_if_data *sdata, | |||
463 | int size; | 463 | int size; |
464 | int err = -EINVAL; | 464 | int err = -EINVAL; |
465 | 465 | ||
466 | old = sdata->u.ap.beacon; | 466 | old = rtnl_dereference(sdata->u.ap.beacon); |
467 | 467 | ||
468 | /* head must not be zero-length */ | 468 | /* head must not be zero-length */ |
469 | if (params->head && !params->head_len) | 469 | if (params->head && !params->head_len) |
@@ -558,8 +558,7 @@ static int ieee80211_add_beacon(struct wiphy *wiphy, struct net_device *dev, | |||
558 | 558 | ||
559 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 559 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
560 | 560 | ||
561 | old = sdata->u.ap.beacon; | 561 | old = rtnl_dereference(sdata->u.ap.beacon); |
562 | |||
563 | if (old) | 562 | if (old) |
564 | return -EALREADY; | 563 | return -EALREADY; |
565 | 564 | ||
@@ -574,8 +573,7 @@ static int ieee80211_set_beacon(struct wiphy *wiphy, struct net_device *dev, | |||
574 | 573 | ||
575 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 574 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
576 | 575 | ||
577 | old = sdata->u.ap.beacon; | 576 | old = rtnl_dereference(sdata->u.ap.beacon); |
578 | |||
579 | if (!old) | 577 | if (!old) |
580 | return -ENOENT; | 578 | return -ENOENT; |
581 | 579 | ||
@@ -589,8 +587,7 @@ static int ieee80211_del_beacon(struct wiphy *wiphy, struct net_device *dev) | |||
589 | 587 | ||
590 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 588 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
591 | 589 | ||
592 | old = sdata->u.ap.beacon; | 590 | old = rtnl_dereference(sdata->u.ap.beacon); |
593 | |||
594 | if (!old) | 591 | if (!old) |
595 | return -ENOENT; | 592 | return -ENOENT; |
596 | 593 | ||