summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/dvm
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-08-21 18:57:11 +0200
committerJohn W. Linville <linville@tuxdriver.com>2012-08-21 15:01:45 -0400
commit4fc79db178f0a0ede479b4713e00df2d106028b3 (patch)
tree2dd1358575382dc449e488e3dc7200f2c821b7cf /drivers/net/wireless/iwlwifi/dvm
parent94543a8d4fb302817014981489f15cb3b92ec3c2 (diff)
iwlwifi: protect SRAM debugfs
If the device is not started, we can't read its SRAM and attempting to do so will cause issues. Protect the debugfs read. Cc: stable@vger.kernel.org Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/dvm')
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/debugfs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/dvm/debugfs.c b/drivers/net/wireless/iwlwifi/dvm/debugfs.c
index 46782f1102a..a47b306b522 100644
--- a/drivers/net/wireless/iwlwifi/dvm/debugfs.c
+++ b/drivers/net/wireless/iwlwifi/dvm/debugfs.c
@@ -124,6 +124,9 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file,
const struct fw_img *img;
size_t bufsz;
+ if (!iwl_is_ready_rf(priv))
+ return -EAGAIN;
+
/* default is to dump the entire data segment */
if (!priv->dbgfs_sram_offset && !priv->dbgfs_sram_len) {
priv->dbgfs_sram_offset = 0x800000;