From: Johannes Berg Date: Tue, 21 Aug 2012 16:57:11 +0000 (+0200) Subject: iwlwifi: protect SRAM debugfs X-Git-Tag: firefly_0821_release~3680^2~2095^2~22^2~22 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4fc79db178f0a0ede479b4713e00df2d106028b3;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/iwlwifi/dvm/debugfs.c b/drivers/net/wireless/iwlwifi/dvm/debugfs.c index 46782f1102ac..a47b306b522c 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;