diff options
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r-- | net/mac80211/cfg.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 94690366321c..303f33fcb844 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -223,11 +223,11 @@ static int ieee80211_get_key(struct wiphy *wiphy, struct net_device *dev, | |||
223 | goto out; | 223 | goto out; |
224 | 224 | ||
225 | if (pairwise) | 225 | if (pairwise) |
226 | key = sta->ptk; | 226 | key = rcu_dereference(sta->ptk); |
227 | else if (key_idx < NUM_DEFAULT_KEYS) | 227 | else if (key_idx < NUM_DEFAULT_KEYS) |
228 | key = sta->gtk[key_idx]; | 228 | key = rcu_dereference(sta->gtk[key_idx]); |
229 | } else | 229 | } else |
230 | key = sdata->keys[key_idx]; | 230 | key = rcu_dereference(sdata->keys[key_idx]); |
231 | 231 | ||
232 | if (!key) | 232 | if (!key) |
233 | goto out; | 233 | goto out; |
@@ -952,8 +952,10 @@ static int ieee80211_change_mpath(struct wiphy *wiphy, | |||
952 | static void mpath_set_pinfo(struct mesh_path *mpath, u8 *next_hop, | 952 | static void mpath_set_pinfo(struct mesh_path *mpath, u8 *next_hop, |
953 | struct mpath_info *pinfo) | 953 | struct mpath_info *pinfo) |
954 | { | 954 | { |
955 | if (mpath->next_hop) | 955 | struct sta_info *next_hop_sta = rcu_dereference(mpath->next_hop); |
956 | memcpy(next_hop, mpath->next_hop->sta.addr, ETH_ALEN); | 956 | |
957 | if (next_hop_sta) | ||
958 | memcpy(next_hop, next_hop_sta->sta.addr, ETH_ALEN); | ||
957 | else | 959 | else |
958 | memset(next_hop, 0, ETH_ALEN); | 960 | memset(next_hop, 0, ETH_ALEN); |
959 | 961 | ||