aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/debugfs_netdev.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-08-25 04:57:06 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-08-26 20:06:33 -0400
commit93015f0f34e81a47c4126329746ce5f364bafd11 (patch)
treea65755403354d28148f8b85627ddf0dd544c9277 /net/mac80211/debugfs_netdev.c
parent667d8af9af775a5fea203890978037ea750816cc (diff)
mac80211: Fix debugfs file add/del for netdev
Previous version was using incorrect union structures for non-AP interfaces when adding and removing max_ratectrl_rateidx and force_unicast_rateidx entries. Depending on the vif type, this ended up in corrupting debugfs entries since the dentries inside different union structures ended up going being on top of eachother.. As the end result, debugfs files were being left behind with references to freed data (instant kernel oops on access) and directories were not removed properly when unloading mac80211 drivers. This patch fixes those issues by using only a single union structure based on the vif type. Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/debugfs_netdev.c')
-rw-r--r--net/mac80211/debugfs_netdev.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c
index 475f89a8aee1..8165df578c92 100644
--- a/net/mac80211/debugfs_netdev.c
+++ b/net/mac80211/debugfs_netdev.c
@@ -248,8 +248,8 @@ IEEE80211_IF_WFILE(min_discovery_timeout,
248static void add_sta_files(struct ieee80211_sub_if_data *sdata) 248static void add_sta_files(struct ieee80211_sub_if_data *sdata)
249{ 249{
250 DEBUGFS_ADD(drop_unencrypted, sta); 250 DEBUGFS_ADD(drop_unencrypted, sta);
251 DEBUGFS_ADD(force_unicast_rateidx, ap); 251 DEBUGFS_ADD(force_unicast_rateidx, sta);
252 DEBUGFS_ADD(max_ratectrl_rateidx, ap); 252 DEBUGFS_ADD(max_ratectrl_rateidx, sta);
253 253
254 DEBUGFS_ADD(state, sta); 254 DEBUGFS_ADD(state, sta);
255 DEBUGFS_ADD(bssid, sta); 255 DEBUGFS_ADD(bssid, sta);
@@ -283,8 +283,8 @@ static void add_ap_files(struct ieee80211_sub_if_data *sdata)
283static void add_wds_files(struct ieee80211_sub_if_data *sdata) 283static void add_wds_files(struct ieee80211_sub_if_data *sdata)
284{ 284{
285 DEBUGFS_ADD(drop_unencrypted, wds); 285 DEBUGFS_ADD(drop_unencrypted, wds);
286 DEBUGFS_ADD(force_unicast_rateidx, ap); 286 DEBUGFS_ADD(force_unicast_rateidx, wds);
287 DEBUGFS_ADD(max_ratectrl_rateidx, ap); 287 DEBUGFS_ADD(max_ratectrl_rateidx, wds);
288 288
289 DEBUGFS_ADD(peer, wds); 289 DEBUGFS_ADD(peer, wds);
290} 290}
@@ -292,8 +292,8 @@ static void add_wds_files(struct ieee80211_sub_if_data *sdata)
292static void add_vlan_files(struct ieee80211_sub_if_data *sdata) 292static void add_vlan_files(struct ieee80211_sub_if_data *sdata)
293{ 293{
294 DEBUGFS_ADD(drop_unencrypted, vlan); 294 DEBUGFS_ADD(drop_unencrypted, vlan);
295 DEBUGFS_ADD(force_unicast_rateidx, ap); 295 DEBUGFS_ADD(force_unicast_rateidx, vlan);
296 DEBUGFS_ADD(max_ratectrl_rateidx, ap); 296 DEBUGFS_ADD(max_ratectrl_rateidx, vlan);
297} 297}
298 298
299static void add_monitor_files(struct ieee80211_sub_if_data *sdata) 299static void add_monitor_files(struct ieee80211_sub_if_data *sdata)
@@ -381,8 +381,8 @@ static void add_files(struct ieee80211_sub_if_data *sdata)
381static void del_sta_files(struct ieee80211_sub_if_data *sdata) 381static void del_sta_files(struct ieee80211_sub_if_data *sdata)
382{ 382{
383 DEBUGFS_DEL(drop_unencrypted, sta); 383 DEBUGFS_DEL(drop_unencrypted, sta);
384 DEBUGFS_DEL(force_unicast_rateidx, ap); 384 DEBUGFS_DEL(force_unicast_rateidx, sta);
385 DEBUGFS_DEL(max_ratectrl_rateidx, ap); 385 DEBUGFS_DEL(max_ratectrl_rateidx, sta);
386 386
387 DEBUGFS_DEL(state, sta); 387 DEBUGFS_DEL(state, sta);
388 DEBUGFS_DEL(bssid, sta); 388 DEBUGFS_DEL(bssid, sta);
@@ -416,8 +416,8 @@ static void del_ap_files(struct ieee80211_sub_if_data *sdata)
416static void del_wds_files(struct ieee80211_sub_if_data *sdata) 416static void del_wds_files(struct ieee80211_sub_if_data *sdata)
417{ 417{
418 DEBUGFS_DEL(drop_unencrypted, wds); 418 DEBUGFS_DEL(drop_unencrypted, wds);
419 DEBUGFS_DEL(force_unicast_rateidx, ap); 419 DEBUGFS_DEL(force_unicast_rateidx, wds);
420 DEBUGFS_DEL(max_ratectrl_rateidx, ap); 420 DEBUGFS_DEL(max_ratectrl_rateidx, wds);
421 421
422 DEBUGFS_DEL(peer, wds); 422 DEBUGFS_DEL(peer, wds);
423} 423}
@@ -425,8 +425,8 @@ static void del_wds_files(struct ieee80211_sub_if_data *sdata)
425static void del_vlan_files(struct ieee80211_sub_if_data *sdata) 425static void del_vlan_files(struct ieee80211_sub_if_data *sdata)
426{ 426{
427 DEBUGFS_DEL(drop_unencrypted, vlan); 427 DEBUGFS_DEL(drop_unencrypted, vlan);
428 DEBUGFS_DEL(force_unicast_rateidx, ap); 428 DEBUGFS_DEL(force_unicast_rateidx, vlan);
429 DEBUGFS_DEL(max_ratectrl_rateidx, ap); 429 DEBUGFS_DEL(max_ratectrl_rateidx, vlan);
430} 430}
431 431
432static void del_monitor_files(struct ieee80211_sub_if_data *sdata) 432static void del_monitor_files(struct ieee80211_sub_if_data *sdata)