linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Emmanuel Grumbach <egrumbach@gmail.com>
To: linux-wireless@vger.kernel.org
Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Subject: [PATCH 5/7] iwlwifi: mvm: BT Coex fix another NULL pointer dereference
Date: Tue, 19 Nov 2013 22:52:04 +0200	[thread overview]
Message-ID: <1384894326-24676-5-git-send-email-egrumbach@gmail.com> (raw)
In-Reply-To: <528BCEDB.8010703@gmail.com>

From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

This patch is very similar to a previous fix: 22cba0c0852f

When we disassociate, mac80211 removes the station and
then, it sets the bss it unsets the assoc bool in bss_info.

Since the firwmware wants it the opposite (first set the
MAC context as unassoc, and only then, remove the STA of
the API), we have a small period of time in which the STA
in firmware doesn't have a valid ieee80211_sta pointer.
During that time, iwl_mvm_vif->ap_sta_id, is still set
to the STA in firmware that represent the AP.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 drivers/net/wireless/iwlwifi/mvm/bt-coex.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/wireless/iwlwifi/mvm/bt-coex.c b/drivers/net/wireless/iwlwifi/mvm/bt-coex.c
index b647147..75b72a9 100644
--- a/drivers/net/wireless/iwlwifi/mvm/bt-coex.c
+++ b/drivers/net/wireless/iwlwifi/mvm/bt-coex.c
@@ -841,6 +841,11 @@ static void iwl_mvm_bt_rssi_iterator(void *_data, u8 *mac,
 
 	sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[mvmvif->ap_sta_id],
 					lockdep_is_held(&mvm->mutex));
+
+	/* This can happen if the station has been removed right now */
+	if (IS_ERR_OR_NULL(sta))
+		return;
+
 	mvmsta = (void *)sta->drv_priv;
 
 	data->num_bss_ifaces++;
-- 
1.7.9.5


  parent reply	other threads:[~2013-11-19 20:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-19 20:49 pull request: iwlwifi 2013-11-19 Emmanuel Grumbach
2013-11-19 20:52 ` [PATCH 1/7] iwlwifi: mvm: check sta_id/drain values in debugfs Emmanuel Grumbach
2013-11-19 20:52 ` [PATCH 2/7] iwlwifi: pcie: refactor a bit the interrupt coalescing Emmanuel Grumbach
2013-11-19 20:52 ` [PATCH 3/7] iwlwifi: add new HW - 7265 series Emmanuel Grumbach
2013-11-19 20:52 ` [PATCH 4/7] iwlwifi: mvm: BT Coex - don't enable MULTI_PRIO_LUT Emmanuel Grumbach
2013-11-19 20:52 ` Emmanuel Grumbach [this message]
2013-11-19 20:52 ` [PATCH 6/7] iwlwifi: mvm: don't WARN about unsuccessful time event Emmanuel Grumbach
2013-11-19 20:52 ` [PATCH 7/7] iwlwifi: bump required firmware API version for 3160/7260 Emmanuel Grumbach
2013-11-24 17:04 ` pull request: iwlwifi 2013-11-19 Emmanuel Grumbach
2013-11-25 20:41   ` John W. Linville
2013-11-25 21:05     ` Emmanuel Grumbach
2013-12-02 17:58       ` John W. Linville

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=1384894326-24676-5-git-send-email-egrumbach@gmail.com \
    --to=egrumbach@gmail.com \
    --cc=emmanuel.grumbach@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    /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).