From: Luciano Coelho <[email protected]>

If the ucode is not loaded, don't allow the temperature test to be
started, but allow it to be changed or stopped if already running.

Signed-off-by: Luciano Coelho <[email protected]>
Reviewed-by: Johannes Berg <[email protected]>
Signed-off-by: Emmanuel Grumbach <[email protected]>
---
 drivers/net/wireless/iwlwifi/mvm/debugfs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs.c 
b/drivers/net/wireless/iwlwifi/mvm/debugfs.c
index d98ee10..85eb847 100644
--- a/drivers/net/wireless/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/iwlwifi/mvm/debugfs.c
@@ -288,6 +288,9 @@ static ssize_t iwl_dbgfs_set_nic_temperature_write(struct 
iwl_mvm *mvm,
 {
        int temperature;
 
+       if (!mvm->ucode_loaded && !mvm->temperature_test)
+               return -EIO;
+
        if (kstrtoint(buf, 10, &temperature))
                return -EINVAL;
        /* not a legal temperature */
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to