Linux wireless drivers development
 help / color / mirror / Atom feed
From: Reinette Chatre <reinette.chatre@linux.intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
	ipw3945-devel@lists.sourceforge.net,
	Tomas Winkler <tomas.winkler@intel.com>,
	Reinette Chatre <reinette.chatre@intel.com>
Subject: [PATCH 02/10] iwlwifi: don't update TFD free counter for invalid station
Date: Thu, 23 Oct 2008 23:48:50 -0700	[thread overview]
Message-ID: <1224830938-1577-3-git-send-email-reinette.chatre@linux.intel.com> (raw)
In-Reply-To: <1224830938-1577-2-git-send-email-reinette.chatre@linux.intel.com>

From: Tomas Winkler <tomas.winkler@intel.com>

This patch makes sure that station table is not accessed
with invalid station id in 4965 TX response path

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-4965.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 881bf04..741b425 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -2236,7 +2236,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
 				   tx_resp->failure_frame);
 
 		freed = iwl_tx_queue_reclaim(priv, txq_id, index);
-		if (qc)
+		if (qc && likely(sta_id != IWL_INVALID_STATION))
 			priv->stations[sta_id].tid[tid].tfds_in_queue -= freed;
 
 		if (priv->mac80211_registered &&
@@ -2244,7 +2244,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
 			ieee80211_wake_queue(priv->hw, txq_id);
 	}
 
-	if (qc)
+	if (qc && likely(sta_id != IWL_INVALID_STATION))
 		iwl_txq_check_empty(priv, sta_id, tid, txq_id);
 
 	if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK))
-- 
1.5.4.3


  reply	other threads:[~2008-10-24  6:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-24  6:48 [PATCH 0/10] iwlwifi driver updates Reinette Chatre
2008-10-24  6:48 ` [PATCH 01/10] iwlwifi: refactor TX response flow Reinette Chatre
2008-10-24  6:48   ` Reinette Chatre [this message]
2008-10-24  6:48     ` [PATCH 03/10] iwlwifi: parametrize eeprom versions Reinette Chatre
2008-10-24  6:48       ` [PATCH 04/10] iwlwifi: calibration command namespace renaming Reinette Chatre
2008-10-24  6:48         ` [PATCH 05/10] iwlwifi: convert correctly rate_n_flags to PLCP index for mimo3 packets Reinette Chatre
2008-10-24  6:48           ` [PATCH 06/10] iwlwifi: clear scanning bits upon failure Reinette Chatre
2008-10-24  6:48             ` [PATCH 07/10] iwlwifi: refactor tx byte count table usage Reinette Chatre
2008-10-24  6:48               ` [PATCH 08/10] iwlwifi: run through spell checker Reinette Chatre
2008-10-24  6:48                 ` [PATCH 09/10] iwl3945: iwl3945_mac_get_tsf() should not return zero Reinette Chatre
2008-10-24  6:48                   ` [PATCH 10/10] iwlwifi: Update reclaim flag Reinette Chatre
2008-10-24  8:27               ` [PATCH 07/10] iwlwifi: refactor tx byte count table usage Johannes Berg

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=1224830938-1577-3-git-send-email-reinette.chatre@linux.intel.com \
    --to=reinette.chatre@linux.intel.com \
    --cc=ipw3945-devel@lists.sourceforge.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=reinette.chatre@intel.com \
    --cc=tomas.winkler@intel.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