Commit 675902ef authored by Sujith's avatar Sujith Committed by John W. Linville
Browse files

ath9k: Fix memleak on TX DMA failure



The driver-specific region has to be freed in case
of a DMA mapping failure.

Cc: stable@kernel.org
Signed-off-by: default avatarSujith <Sujith.Manoharan@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent d2f5b3a6
...@@ -1572,8 +1572,9 @@ static int ath_tx_setup_buffer(struct ieee80211_hw *hw, struct ath_buf *bf, ...@@ -1572,8 +1572,9 @@ static int ath_tx_setup_buffer(struct ieee80211_hw *hw, struct ath_buf *bf,
skb->len, DMA_TO_DEVICE); skb->len, DMA_TO_DEVICE);
if (unlikely(dma_mapping_error(sc->dev, bf->bf_dmacontext))) { if (unlikely(dma_mapping_error(sc->dev, bf->bf_dmacontext))) {
bf->bf_mpdu = NULL; bf->bf_mpdu = NULL;
DPRINTF(sc, ATH_DBG_CONFIG, kfree(tx_info_priv);
"dma_mapping_error() on TX\n"); tx_info->rate_driver_data[0] = NULL;
DPRINTF(sc, ATH_DBG_FATAL, "dma_mapping_error() on TX\n");
return -ENOMEM; return -ENOMEM;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment