Skip to content

Commit 882b7b7

Browse files
jmberg-intellinvjw
authored andcommitted
iwlwifi: remove log_event debugfs file debugging is disabled
When debugging is disabled, the event log functions aren't functional in the way that the debugfs file expects. This leads to the debugfs access crashing. Since the event log functions aren't functional then, remove the debugfs file when CONFIG_IWLWIFI_DEBUG is not set. Cc: stable@kernel.org Reported-by: Lekensteyn <lekensteyn@gmail.com> Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent f18e3c6 commit 882b7b7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/net/wireless/iwlwifi/iwl-debugfs.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2239,6 +2239,7 @@ static ssize_t iwl_dbgfs_echo_test_write(struct file *file,
22392239
return count;
22402240
}
22412241

2242+
#ifdef CONFIG_IWLWIFI_DEBUG
22422243
static ssize_t iwl_dbgfs_log_event_read(struct file *file,
22432244
char __user *user_buf,
22442245
size_t count, loff_t *ppos)
@@ -2276,6 +2277,7 @@ static ssize_t iwl_dbgfs_log_event_write(struct file *file,
22762277

22772278
return count;
22782279
}
2280+
#endif
22792281

22802282
static ssize_t iwl_dbgfs_calib_disabled_read(struct file *file,
22812283
char __user *user_buf,
@@ -2345,7 +2347,9 @@ DEBUGFS_READ_FILE_OPS(bt_traffic);
23452347
DEBUGFS_READ_WRITE_FILE_OPS(protection_mode);
23462348
DEBUGFS_READ_FILE_OPS(reply_tx_error);
23472349
DEBUGFS_WRITE_FILE_OPS(echo_test);
2350+
#ifdef CONFIG_IWLWIFI_DEBUG
23482351
DEBUGFS_READ_WRITE_FILE_OPS(log_event);
2352+
#endif
23492353
DEBUGFS_READ_WRITE_FILE_OPS(calib_disabled);
23502354

23512355
/*
@@ -2405,7 +2409,9 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
24052409
DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR);
24062410
DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR);
24072411
DEBUGFS_ADD_FILE(echo_test, dir_debug, S_IWUSR);
2412+
#ifdef CONFIG_IWLWIFI_DEBUG
24082413
DEBUGFS_ADD_FILE(log_event, dir_debug, S_IWUSR | S_IRUSR);
2414+
#endif
24092415

24102416
if (iwl_advanced_bt_coexist(priv))
24112417
DEBUGFS_ADD_FILE(bt_traffic, dir_debug, S_IRUSR);

0 commit comments

Comments
 (0)