From 4a67d9e8b1bba8b60e8b57d95e0a777f36be02dd Mon Sep 17 00:00:00 2001 From: Rui Paulo Date: Wed, 7 Apr 2010 17:49:47 +0000 Subject: [PATCH] Avoid NULL deref. Submitted by: gavin MFC after: 1 month --- sys/dev/bwi/if_bwi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/bwi/if_bwi.c b/sys/dev/bwi/if_bwi.c index c77004d2b5f..96c5cc6d3e5 100644 --- a/sys/dev/bwi/if_bwi.c +++ b/sys/dev/bwi/if_bwi.c @@ -3368,10 +3368,10 @@ _bwi_txeof(struct bwi_softc *sc, uint16_t tx_id, int acked, int data_txcnt) bus_dmamap_unload(sc->sc_buf_dtag, tb->tb_dmap); ni = tb->tb_ni; - vap = ni->ni_vap; if (tb->tb_ni != NULL) { const struct bwi_txbuf_hdr *hdr = mtod(tb->tb_mbuf, const struct bwi_txbuf_hdr *); + vap = ni->ni_vap; /* NB: update rate control only for unicast frames */ if (hdr->txh_mac_ctrl & htole32(BWI_TXH_MAC_C_ACK)) {