linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iwlagn: check for !priv->txq in iwlagn_wait_tx_queue_empty
@ 2011-07-25 19:38 Keith Packard
  2011-07-25 19:21 ` Guy, Wey-Yi
  2011-07-25 19:36 ` wwguy
  0 siblings, 2 replies; 9+ messages in thread
From: Keith Packard @ 2011-07-25 19:38 UTC (permalink / raw)
  To: Wey-Yi Guy, Intel Linux Wireless
  Cc: linux-wireless, linux-kernel, Keith Packard

If the interface is down, txq is NULL. iwlagn_wait_tx_queue_empty
needs to check for this case to avoid dereferencing that pointer.

Signed-off-by: Keith Packard <keithp@keithp.com>
---

This is on top of v3.0

 drivers/net/wireless/iwlwifi/iwl-agn-lib.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index f803fb6..d6ae444 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -1487,6 +1487,9 @@ int iwlagn_wait_tx_queue_empty(struct iwl_priv *priv)
 	unsigned long now = jiffies;
 	int ret = 0;
 
+	if (!priv->txq)
+		return 0;
+
 	/* waiting for all the tx frames complete might take a while */
 	for (cnt = 0; cnt < priv->hw_params.max_txq_num; cnt++) {
 		if (cnt == priv->cmd_queue)
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-07-30  0:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-25 19:38 [PATCH] iwlagn: check for !priv->txq in iwlagn_wait_tx_queue_empty Keith Packard
2011-07-25 19:21 ` Guy, Wey-Yi
2011-07-25 20:03   ` Keith Packard
2011-07-25 20:59     ` wwguy
2011-07-26  6:45       ` Keith Packard
2011-07-26 13:22         ` Guy, Wey-Yi
2011-07-30  0:52           ` Keith Packard
2011-07-25 19:36 ` wwguy
2011-07-25 19:43   ` Keith Packard

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).