From: Roland Dreier <rdreier@cisco.com>
To: "Zdenek Kabelac" <zdenek.kabelac@gmail.com>,
linux-wireless@vger.kernel.org, linville@tuxdriver.com
Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>,
Tomas Winkler <tomas.winkler@intel.com>,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: [PATCH] iwlwifi: Don't unlock priv->mutex if it isn't locked
Date: Wed, 23 Apr 2008 16:22:13 -0700 [thread overview]
Message-ID: <adazlrk88d6.fsf@cisco.com> (raw)
In-Reply-To: <c4e36d110804231600l4b540a3ka637dedca0d7687b@mail.gmail.com> (Zdenek Kabelac's message of "Thu, 24 Apr 2008 01:00:34 +0200")
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;
}
parent reply other threads:[~2008-04-23 23:22 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <c4e36d110804231600l4b540a3ka637dedca0d7687b@mail.gmail.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=adazlrk88d6.fsf@cisco.com \
--to=rdreier@cisco.com \
--cc=emmanuel.grumbach@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=tomas.winkler@intel.com \
--cc=zdenek.kabelac@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).