From patchwork Fri May 14 14:50:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 99620 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4EEpVVs026423 for ; Fri, 14 May 2010 14:51:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751560Ab0ENOva (ORCPT ); Fri, 14 May 2010 10:51:30 -0400 Received: from mail-ww0-f46.google.com ([74.125.82.46]:56093 "EHLO mail-ww0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750999Ab0ENOv3 (ORCPT ); Fri, 14 May 2010 10:51:29 -0400 Received: by wwi18 with SMTP id 18so599560wwi.19 for ; Fri, 14 May 2010 07:51:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=8nmk7nPsix1sokwj/r2ZJIboy8Z5MhvUV+QcRCKVRe0=; b=OOID2JjqOkKlOkTqydxyLWFpq6OC/jmYYv3mBaMR+qNJVTyFd7dY4jryh3//s0POa2 uxy3w8CEXpU8ScdY+Y/doEzh8r3JG1MB/4ST2Lt/XvlJts6BO9rK6N5AN+sulK7dk1eh vTsEek4P4ncr7YWqd3itoGmyUCEJdAE6jUyls= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=TlphaEyZjyOPEdgaLCP7pQdSu+S418x3QqgDNDVSOKX2XVWdGBSfGCupFxN632ABdc eCbInsntz/9sIYouSyLd3iiYmt5kDpqEkQz3OXRnPm3bKqKjBlqoTItNx0CKKjiopw1G JTQE78cPclDs23EwS7v/QX+Bvw5IezKBj4Nb0= Received: by 10.216.85.79 with SMTP id t57mr945637wee.132.1273848687811; Fri, 14 May 2010 07:51:27 -0700 (PDT) Received: from bicker ([205.177.176.130]) by mx.google.com with ESMTPS id n61sm1202404wed.6.2010.05.14.07.51.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 14 May 2010 07:51:27 -0700 (PDT) Date: Fri, 14 May 2010 16:50:56 +0200 From: Dan Carpenter To: "Luis R. Rodriguez" Cc: Jouni Malinen , Sujith Manoharan , Vasanthakumar Thiagarajan , Senthil Balasubramanian , "John W. Linville" , Ming Lei , linux-wireless@vger.kernel.org, ath9k-devel@venema.h4ckr.net Subject: [patch -next 1/2] ath9k_htc: dereferencing before check in hif_usb_tx_cb() Message-ID: <20100514145056.GE17487@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) 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.3 (demeter.kernel.org [140.211.167.41]); Fri, 14 May 2010 14:51:32 +0000 (UTC) diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c index 46dc41a..ac82911 100644 --- a/drivers/net/wireless/ath/ath9k/hif_usb.c +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c @@ -107,12 +107,14 @@ static inline void ath9k_skb_queue_purge(struct hif_device_usb *hif_dev, static void hif_usb_tx_cb(struct urb *urb) { struct tx_buf *tx_buf = (struct tx_buf *) urb->context; - struct hif_device_usb *hif_dev = tx_buf->hif_dev; + struct hif_device_usb *hif_dev; struct sk_buff *skb; - if (!hif_dev || !tx_buf) + if (!tx_buf || !tx_buf->hif_dev) return; + hif_dev = tx_buf->hif_dev; + switch (urb->status) { case 0: break;