Search Linux Wireless

[PATCH] iwlagn: check for !priv->txq in iwlagn_wait_tx_queue_empty

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---

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

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux