ral - Move NULL test to correct location and remove useless cast.
authorJoe Talbott <josepht@dragonflybsd.org>
Tue, 27 Jul 2010 01:33:43 +0000 (21:33 -0400)
committerJoe Talbott <josepht@dragonflybsd.org>
Tue, 27 Jul 2010 17:50:06 +0000 (13:50 -0400)
Reported-By: Max Herrgard
sys/dev/netif/ral/rt2661.c

index b8bd68b..d6051c8 100644 (file)
@@ -898,14 +898,16 @@ rt2661_tx_intr(struct rt2661_softc *sc)
                data = &txq->data[txq->stat];
                m = data->m;
                data->m = NULL;
+
                ni = data->ni;
                data->ni = NULL;
-               vap = ni->ni_vap;
 
                /* if no frame has been sent, ignore */
                if (ni == NULL)
                        continue;
 
+               vap = ni->ni_vap;
+
                switch (RT2661_TX_RESULT(val)) {
                case RT2661_TX_SUCCESS:
                        retrycnt = RT2661_TX_RETRYCNT(val);
@@ -1491,7 +1493,7 @@ rt2661_tx_data(struct rt2661_softc *sc, struct mbuf *m0,
        } else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) {
                rate = tp->ucastrate;
        } else {
-               (void) ieee80211_ratectl_rate(ni, NULL, 0);
+               ieee80211_ratectl_rate(ni, NULL, 0);
                rate = ni->ni_txrate;
        }
        rate &= IEEE80211_RATE_VAL;