diff options
author | Richard A. Griffiths <richardx.a.griffiths@intel.com> | 2012-06-28 20:14:11 (GMT) |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-07-03 12:03:26 (GMT) |
commit | 0ff1bd35f5aece42879b04cbfe6b4040cf50a697 (patch) | |
tree | d6e58a2fc91c3febd77651458a8a0e1dd2e0c499 /drivers | |
parent | bd408b33363035275403cfaadf2683d8c8e22dd7 (diff) | |
download | linux-fsl-qoriq-0ff1bd35f5aece42879b04cbfe6b4040cf50a697.tar.xz |
iwlwifi: disallow log_event access if interface down
'echo 1 > log_event' generates the bogus "MAC is in deep sleep"
or "Timeout waiting for hardware access" log messages when
the interface is down, we should just disallow accessing the
device through debugfs when it is down.
Signed-off-by: Richard A. Griffiths <richardx.a.griffiths@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/dvm/debugfs.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/dvm/debugfs.c b/drivers/net/wireless/iwlwifi/dvm/debugfs.c index 8a2d9e6..b0f125c 100644 --- a/drivers/net/wireless/iwlwifi/dvm/debugfs.c +++ b/drivers/net/wireless/iwlwifi/dvm/debugfs.c @@ -83,7 +83,7 @@ static ssize_t iwl_dbgfs_##name##_write(struct file *file, \ #define DEBUGFS_READ_FILE_OPS(name) \ DEBUGFS_READ_FUNC(name); \ static const struct file_operations iwl_dbgfs_##name##_ops = { \ - .read = iwl_dbgfs_##name##_read, \ + .read = iwl_dbgfs_##name##_read, \ .open = simple_open, \ .llseek = generic_file_llseek, \ }; @@ -2254,6 +2254,10 @@ static ssize_t iwl_dbgfs_log_event_write(struct file *file, char buf[8]; int buf_size; + /* check that the interface is up */ + if (!iwl_is_ready(priv)) + return -EAGAIN; + memset(buf, 0, sizeof(buf)); buf_size = min(count, sizeof(buf) - 1); if (copy_from_user(buf, user_buf, buf_size)) |