diff options
author | Ben Greear <greearb@candelatech.com> | 2010-10-14 15:45:30 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-10-15 15:57:42 -0400 |
commit | 6cf9e995f91e5bbffb2bef85feef490e5b67605d (patch) | |
tree | 11d458a9a447fadb4b85a90664d327055f67b66f /drivers/net/wireless/ath/ath9k/recv.c | |
parent | c1739eb3e61e160f124bc842c219011916f63068 (diff) |
ath9k: Null out references to stale pointers.
This doesn't fix any problem that I'm aware of, but should
make it harder to add use-after-free type bugs in the
future.
Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/recv.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/recv.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index 2e427522672d..fe73fc50082a 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c | |||
@@ -268,6 +268,7 @@ static int ath_rx_edma_init(struct ath_softc *sc, int nbufs) | |||
268 | bf->bf_buf_addr))) { | 268 | bf->bf_buf_addr))) { |
269 | dev_kfree_skb_any(skb); | 269 | dev_kfree_skb_any(skb); |
270 | bf->bf_mpdu = NULL; | 270 | bf->bf_mpdu = NULL; |
271 | bf->bf_buf_addr = 0; | ||
271 | ath_print(common, ATH_DBG_FATAL, | 272 | ath_print(common, ATH_DBG_FATAL, |
272 | "dma_mapping_error() on RX init\n"); | 273 | "dma_mapping_error() on RX init\n"); |
273 | error = -ENOMEM; | 274 | error = -ENOMEM; |
@@ -358,6 +359,7 @@ int ath_rx_init(struct ath_softc *sc, int nbufs) | |||
358 | bf->bf_buf_addr))) { | 359 | bf->bf_buf_addr))) { |
359 | dev_kfree_skb_any(skb); | 360 | dev_kfree_skb_any(skb); |
360 | bf->bf_mpdu = NULL; | 361 | bf->bf_mpdu = NULL; |
362 | bf->bf_buf_addr = 0; | ||
361 | ath_print(common, ATH_DBG_FATAL, | 363 | ath_print(common, ATH_DBG_FATAL, |
362 | "dma_mapping_error() on RX init\n"); | 364 | "dma_mapping_error() on RX init\n"); |
363 | error = -ENOMEM; | 365 | error = -ENOMEM; |
@@ -392,6 +394,8 @@ void ath_rx_cleanup(struct ath_softc *sc) | |||
392 | common->rx_bufsize, | 394 | common->rx_bufsize, |
393 | DMA_FROM_DEVICE); | 395 | DMA_FROM_DEVICE); |
394 | dev_kfree_skb(skb); | 396 | dev_kfree_skb(skb); |
397 | bf->bf_buf_addr = 0; | ||
398 | bf->bf_mpdu = NULL; | ||
395 | } | 399 | } |
396 | } | 400 | } |
397 | 401 | ||
@@ -1733,6 +1737,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp) | |||
1733 | bf->bf_buf_addr))) { | 1737 | bf->bf_buf_addr))) { |
1734 | dev_kfree_skb_any(requeue_skb); | 1738 | dev_kfree_skb_any(requeue_skb); |
1735 | bf->bf_mpdu = NULL; | 1739 | bf->bf_mpdu = NULL; |
1740 | bf->bf_buf_addr = 0; | ||
1736 | ath_print(common, ATH_DBG_FATAL, | 1741 | ath_print(common, ATH_DBG_FATAL, |
1737 | "dma_mapping_error() on RX\n"); | 1742 | "dma_mapping_error() on RX\n"); |
1738 | ath_rx_send_to_mac80211(hw, sc, skb, rxs); | 1743 | ath_rx_send_to_mac80211(hw, sc, skb, rxs); |