From patchwork Mon Jul 25 19:38:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Packard X-Patchwork-Id: 1005892 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6PJcsGQ004494 for ; Mon, 25 Jul 2011 19:38:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752738Ab1GYTie (ORCPT ); Mon, 25 Jul 2011 15:38:34 -0400 Received: from home.keithp.com ([63.227.221.253]:53390 "EHLO keithp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752694Ab1GYTie (ORCPT ); Mon, 25 Jul 2011 15:38:34 -0400 Received: from localhost (localhost [127.0.0.1]) by keithp.com (Postfix) with ESMTP id AF731760196; Mon, 25 Jul 2011 12:38:33 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from keithp.com ([127.0.0.1]) by localhost (keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id jgfbz7V3XFXC; Mon, 25 Jul 2011 12:38:31 -0700 (PDT) Received: by keithp.com (Postfix, from userid 1033) id 3CE52D74004; Mon, 25 Jul 2011 12:38:31 -0700 (PDT) Received: from koto.keithp.com (localhost [127.0.0.1]) by keithp.com (Postfix) with ESMTP id 3B6B1760196; Mon, 25 Jul 2011 12:38:31 -0700 (PDT) Received: by koto.keithp.com (Postfix, from userid 1488) id C3909642496; Mon, 25 Jul 2011 12:38:30 -0700 (PDT) From: Keith Packard To: Wey-Yi Guy , Intel Linux Wireless Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Keith Packard Subject: [PATCH] iwlagn: check for !priv->txq in iwlagn_wait_tx_queue_empty Date: Mon, 25 Jul 2011 12:38:22 -0700 Message-Id: <1311622702-4807-1-git-send-email-keithp@keithp.com> X-Mailer: git-send-email 1.7.5.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 25 Jul 2011 19:38:54 +0000 (UTC) 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 --- 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)