login
Header Space

 
 

[PATCH] iwlwifi: Don't unlock priv->mutex if it isn't locked

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Zdenek Kabelac <zdenek.kabelac@...>, <linux-wireless@...>, <linville@...>
Cc: Emmanuel Grumbach <emmanuel.grumbach@...>, Tomas Winkler <tomas.winkler@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Wednesday, April 23, 2008 - 7:22 pm

Commit b716bb91 ("iwlwifi: Cancel scanning upon association") moved the
test of priv->vif in iwl{3945,4964}_mac_config_interface() outside of
where priv->mutex is held, but still tries to do mutex_unlock() on
return.  This is clearly wrong and triggers a nasty lockdep warning when
this codepath is triggered.  Fix this by removing the mutex_unlock().

Signed-off-by: Roland Dreier <rolandd@cisco.com>
---
Assuming the original b716bb91 commit is correct, this is probably the
right fix.  But I'm not sure if it's correct to look at priv->vif
without holding priv->mutex, so maybe the fix is more complicated.

 drivers/net/wireless/iwlwifi/iwl3945-base.c |    1 -
 drivers/net/wireless/iwlwifi/iwl4965-base.c |    1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 1a5678f..a1a0b3c 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -6907,7 +6907,6 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
 
 	if (priv->vif != vif) {
 		IWL_DEBUG_MAC80211("leave - priv->vif != vif\n");
-		mutex_unlock(&priv->mutex);
 		return 0;
 	}
 
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index d7e2358..d0bbcaa 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -6473,7 +6473,6 @@ static int iwl4965_mac_config_interface(struct ieee80211_hw *hw,
 
 	if (priv->vif != vif) {
 		IWL_DEBUG_MAC80211("leave - priv->vif != vif\n");
-		mutex_unlock(&priv->mutex);
 		return 0;
 	}
 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] iwlwifi: Don't unlock priv->mutex if it isn't locked, Roland Dreier, (Wed Apr 23, 7:22 pm)
speck-geostationary