iwlwifi: iwl_power_update_mode always hold mutex
iwl_power_update_mode expects to be called with mutex held, for example to protect priv->vif. Only one caller currently does not do this, fix this. Also, add a comment to iwl_power_update_mode to indicate this requirement. Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
This commit is contained in:
Родитель
7ae810776a
Коммит
d3a571971e
|
@ -815,7 +815,9 @@ static ssize_t iwl_dbgfs_sleep_level_override_write(struct file *file,
|
||||||
|
|
||||||
priv->power_data.debug_sleep_level_override = value;
|
priv->power_data.debug_sleep_level_override = value;
|
||||||
|
|
||||||
|
mutex_lock(&priv->mutex);
|
||||||
iwl_power_update_mode(priv, true);
|
iwl_power_update_mode(priv, true);
|
||||||
|
mutex_unlock(&priv->mutex);
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
|
@ -303,7 +303,7 @@ static int iwl_set_power(struct iwl_priv *priv, struct iwl_powertable_cmd *cmd)
|
||||||
sizeof(struct iwl_powertable_cmd), cmd);
|
sizeof(struct iwl_powertable_cmd), cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* priv->mutex must be held */
|
||||||
int iwl_power_update_mode(struct iwl_priv *priv, bool force)
|
int iwl_power_update_mode(struct iwl_priv *priv, bool force)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче