Commit 22d4436d authored by Johannes Berg's avatar Johannes Berg Committed by Ben Hutchings

iwlwifi: protect SRAM debugfs

commit 4fc79db1 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: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
[bwh: Backported to 3.2:
 - Adjust context
 - Pass iwl_shared not iwl_priv pointer to iwl_is_ready_rf()]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent cfc41fe5
......@@ -232,6 +232,9 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file,
struct iwl_priv *priv = file->private_data;
size_t bufsz;
if (!iwl_is_ready_rf(priv->shrd))
return -EAGAIN;
/* default is to dump the entire data segment */
if (!priv->dbgfs_sram_offset && !priv->dbgfs_sram_len) {
priv->dbgfs_sram_offset = 0x800000;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment