diff options
author | David S. Miller <davem@davemloft.net> | 2017-01-09 21:39:11 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-01-09 21:39:11 +0100 |
commit | bb1d3034449ed08e2ffbf5813a5ad9fa30475359 (patch) | |
tree | a48cc17fc4683b5fdc1656ac71639540bd8852e2 /drivers/net/ethernet/broadcom/tg3.c | |
parent | Merge branch 'dwmac-dwc-qos-eth' (diff) | |
parent | phy state machine: failsafe leave invalid RUNNING state (diff) | |
download | linux-bb1d3034449ed08e2ffbf5813a5ad9fa30475359.tar.xz linux-bb1d3034449ed08e2ffbf5813a5ad9fa30475359.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'drivers/net/ethernet/broadcom/tg3.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/tg3.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 800328f562fa..a448177990fe 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -8720,11 +8720,14 @@ static void tg3_free_consistent(struct tg3 *tp) tg3_mem_rx_release(tp); tg3_mem_tx_release(tp); + /* Protect tg3_get_stats64() from reading freed tp->hw_stats. */ + tg3_full_lock(tp, 0); if (tp->hw_stats) { dma_free_coherent(&tp->pdev->dev, sizeof(struct tg3_hw_stats), tp->hw_stats, tp->stats_mapping); tp->hw_stats = NULL; } + tg3_full_unlock(tp); } /* |