ath9k_htc: dereferencing before check in hif_usb_tx_cb()
authorDan Carpenter <error27@gmail.com>
Fri, 14 May 2010 14:50:56 +0000 (16:50 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 24 May 2010 19:07:42 +0000 (15:07 -0400)
After c11d8f89d3b7: "ath9k_htc: Simplify TX URB management" we no longer
assume that tx_buf is a non-null pointer.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/hif_usb.c

index 46dc41a16faa23e9edbb213c55d39523c6fb0a41..ac82911ee609d1f686ccfc46fafebff310a4407c 100644 (file)
@@ -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;