projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bd408b3
)
iwlwifi: disallow log_event access if interface down
author
Richard A. Griffiths
<
[email protected]
>
Thu, 28 Jun 2012 20:14:11 +0000
(13:14 -0700)
committer
Johannes Berg
<
[email protected]
>
Tue, 3 Jul 2012 12:03:26 +0000
(14:03 +0200)
'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 <
[email protected]
>
Reviewed-by: Emmanuel Grumbach <
[email protected]
>
Signed-off-by: Johannes Berg <
[email protected]
>
drivers/net/wireless/iwlwifi/dvm/debugfs.c
patch
|
blob
|
history
diff --git
a/drivers/net/wireless/iwlwifi/dvm/debugfs.c
b/drivers/net/wireless/iwlwifi/dvm/debugfs.c
index 8a2d9e643b14a5f809c4feb02c7d311ac582aed7..b0f125c985cd4fac49e06f98a91eb4b741624d41 100644
(file)
--- 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))