diff options
author | Reinette Chatre <reinette.chatre@intel.com> | 2010-01-21 14:52:28 -0500 |
---|---|---|
committer | Reinette Chatre <reinette.chatre@intel.com> | 2010-01-29 14:13:59 -0500 |
commit | d3a571971e5af241074947fc80f6284677f6e014 (patch) | |
tree | d01bb4af20ecfadf36626fb57f3d0918b9653d14 /drivers | |
parent | 7ae810776a51dc4dc6580013b0f6ba0f34d2b165 (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debugfs.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-power.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index 5c8377b9ad9b..d134301b553c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -815,7 +815,9 @@ static ssize_t iwl_dbgfs_sleep_level_override_write(struct file *file, | |||
815 | 815 | ||
816 | priv->power_data.debug_sleep_level_override = value; | 816 | priv->power_data.debug_sleep_level_override = value; |
817 | 817 | ||
818 | mutex_lock(&priv->mutex); | ||
818 | iwl_power_update_mode(priv, true); | 819 | iwl_power_update_mode(priv, true); |
820 | mutex_unlock(&priv->mutex); | ||
819 | 821 | ||
820 | return count; | 822 | return count; |
821 | } | 823 | } |
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c index 232dd1879baf..1a1a9f081cc7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-power.c +++ b/drivers/net/wireless/iwlwifi/iwl-power.c | |||
@@ -303,7 +303,7 @@ static int iwl_set_power(struct iwl_priv *priv, struct iwl_powertable_cmd *cmd) | |||
303 | sizeof(struct iwl_powertable_cmd), cmd); | 303 | sizeof(struct iwl_powertable_cmd), cmd); |
304 | } | 304 | } |
305 | 305 | ||
306 | 306 | /* priv->mutex must be held */ | |
307 | int iwl_power_update_mode(struct iwl_priv *priv, bool force) | 307 | int iwl_power_update_mode(struct iwl_priv *priv, bool force) |
308 | { | 308 | { |
309 | int ret = 0; | 309 | int ret = 0; |