]> Pileus Git - ~andy/linux/commitdiff
ath9k: correct warning about unintialized variable 'tid'
authorJohn W. Linville <linville@tuxdriver.com>
Fri, 31 Oct 2008 20:45:15 +0000 (16:45 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 10 Nov 2008 20:17:35 +0000 (15:17 -0500)
drivers/net/wireless/ath9k/xmit.c: In function ‘ath_tx_start’:
drivers/net/wireless/ath9k/xmit.c:1858: warning: ‘tid’ may be used uninitialized in this function

Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath9k/xmit.c

index fe386b6dadac868b4ddb11cd68e0304adc297e8b..8937728b03018a30a204913f49ba85c92e06c88b 100644 (file)
@@ -1859,11 +1859,6 @@ static void ath_tx_start_dma(struct ath_softc *sc, struct ath_buf *bf,
        struct ath_hal *ah = sc->sc_ah;
        int frm_type;
 
-       if (tx_info->control.sta) {
-               an = (struct ath_node *)tx_info->control.sta->drv_priv;
-               tid = ATH_AN_2_TID(an, bf->bf_tidno);
-       }
-
        frm_type = get_hw_packet_type(skb);
 
        INIT_LIST_HEAD(&bf_head);
@@ -1890,7 +1885,11 @@ static void ath_tx_start_dma(struct ath_softc *sc, struct ath_buf *bf,
 
        spin_lock_bh(&txctl->txq->axq_lock);
 
-       if (bf_isht(bf) && (sc->sc_flags & SC_OP_TXAGGR)) {
+       if (bf_isht(bf) && (sc->sc_flags & SC_OP_TXAGGR) &&
+           tx_info->control.sta) {
+               an = (struct ath_node *)tx_info->control.sta->drv_priv;
+               tid = ATH_AN_2_TID(an, bf->bf_tidno);
+
                if (ath_aggr_query(sc, an, bf->bf_tidno)) {
                        /*
                         * Try aggregation if it's a unicast data frame