diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-03-31 19:23:00 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-04-01 17:14:09 -0400 |
commit | 97bff8ecf4e4e26749a67dcfbb7565d8a0f4acb4 (patch) | |
tree | 1aecc15d8fa842af2b26edd1a68a713ae0008d57 /net/mac80211/sta_info.c | |
parent | 9dd6aed05b8859265cd79f1e47e4f844bbe1548b (diff) |
mac80211: fix sta_info_destroy(NULL)
sta_info_destroy(NULL) should be valid, but currently isn't because
the argument is dereferenced before the NULL check. There are no
users that currently pass in NULL, i.e. all check before calling the
function, but I want to change that.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/sta_info.c')
-rw-r--r-- | net/mac80211/sta_info.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index f708367092d1..2a5a2f067bae 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -129,16 +129,18 @@ struct sta_info *sta_info_get_by_idx(struct ieee80211_local *local, int idx, void sta_info_destroy(struct sta_info *sta) { - struct ieee80211_local *local = sta->local; + struct ieee80211_local *local; struct sk_buff *skb; int i; DECLARE_MAC_BUF(mbuf); + ASSERT_RTNL(); + might_sleep(); + if (!sta) return; - ASSERT_RTNL(); - might_sleep(); + local = sta->local; rate_control_remove_sta_debugfs(sta); ieee80211_sta_debugfs_remove(sta); |