summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorMichael Chan <michael.chan@broadcom.com>2018-05-03 20:04:27 -0400
committerDavid S. Miller <davem@davemloft.net>2018-05-04 12:57:17 -0400
commitd89a2adb8bfe6f8949ff389acdb9fa298b6e8e12 (patch)
tree49dfd594495bc0d5b9bb790b18841e276c0ef68d /net
parentaf50e4ba34f4c45e92535364133d4deb5931c1c5 (diff)
tg3: Fix vunmap() BUG_ON() triggered from tg3_free_consistent().
tg3_free_consistent() calls dma_free_coherent() to free tp->hw_stats under spinlock and can trigger BUG_ON() in vunmap() because vunmap() may sleep. Fix it by removing the spinlock and relying on the TG3_FLAG_INIT_COMPLETE flag to prevent race conditions between tg3_get_stats64() and tg3_free_consistent(). TG3_FLAG_INIT_COMPLETE is always cleared under tp->lock before tg3_free_consistent() and therefore tg3_get_stats64() can safely access tp->hw_stats under tp->lock if TG3_FLAG_INIT_COMPLETE is set. Fixes: f5992b72ebe0 ("tg3: Fix race condition in tg3_get_stats64().") Reported-by: Zumeng Chen <zumeng.chen@gmail.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions