Commit 032422c
tg3: Fix race condition in tg3_get_stats64().
[ Upstream commit f5992b72ebe0dde488fa8f706b887194020c66fc ]
The driver's ndo_get_stats64() method is not always called under RTNL.
So it can race with driver close or ethtool reconfigurations. Fix the
race condition by taking tp->lock spinlock in tg3_free_consistent()
when freeing the tp->hw_stats memory block. tg3_get_stats64() is
already taking tp->lock.
Reported-by: Wang Yufen <wangyufen@huawei.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 93585e8 commit 032422c
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8722 | 8722 | | |
8723 | 8723 | | |
8724 | 8724 | | |
| 8725 | + | |
| 8726 | + | |
8725 | 8727 | | |
8726 | 8728 | | |
8727 | 8729 | | |
8728 | 8730 | | |
8729 | 8731 | | |
| 8732 | + | |
8730 | 8733 | | |
8731 | 8734 | | |
8732 | 8735 | | |
| |||
0 commit comments