Explorar el Código

iwlwifi: mvm: fail temp test enabling if the ucode is not loaded

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 <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Luciano Coelho hace 11 años
padre
commit
a26d4e7b09
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      drivers/net/wireless/iwlwifi/mvm/debugfs.c

+ 3 - 0
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;
 	int temperature;
 
 
+	if (!mvm->ucode_loaded && !mvm->temperature_test)
+		return -EIO;
+
 	if (kstrtoint(buf, 10, &temperature))
 	if (kstrtoint(buf, 10, &temperature))
 		return -EINVAL;
 		return -EINVAL;
 	/* not a legal temperature */
 	/* not a legal temperature */