diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-08-21 18:57:11 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-02 10:39:45 -0700 |
commit | cf7516923d7ee975b21a1ea633f6a9c65fef66e3 (patch) | |
tree | 9bd30ab19609617149c9604682731c4c06a5eecc | |
parent | 54abcfeb2ce031f864b8a8c574333446af335c3c (diff) | |
download | lwn-cf7516923d7ee975b21a1ea633f6a9c65fef66e3.tar.gz lwn-cf7516923d7ee975b21a1ea633f6a9c65fef66e3.zip |
iwlwifi: protect SRAM debugfs
commit 4fc79db178f0a0ede479b4713e00df2d106028b3 upstream.
If the device is not started, we can't read its
SRAM and attempting to do so will cause issues.
Protect the debugfs read.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debugfs.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index 7f97dec8534d..5000690138d5 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c @@ -128,6 +128,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; |