diff options
author | Yunsheng Lin <linyunsheng@huawei.com> | 2019-04-25 20:42:45 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-26 12:13:28 -0400 |
commit | 26cda2f1613878d9bde11325559f4fca92fff395 (patch) | |
tree | 96d9e8b0e49c895a426e2725d195ed2e4580629f /drivers/cpufreq/cpufreq_ondemand.c | |
parent | 790d23e7c577ed2ef7c49f246ad8d53691fb1b20 (diff) | |
download | linux-rpi-26cda2f1613878d9bde11325559f4fca92fff395.tar.gz linux-rpi-26cda2f1613878d9bde11325559f4fca92fff395.tar.bz2 linux-rpi-26cda2f1613878d9bde11325559f4fca92fff395.zip |
net: hns3: fix data race between ring->next_to_clean
hns3_clean_tx_ring calls hns3_nic_reclaim_one_desc to clean
buffers and set ring->next_to_clean, then hns3_nic_net_xmit
reuses the cleaned buffers. But there are no memory barriers
when buffers gets recycled, so the recycled buffers can be
corrupted.
This patch uses smp_store_release to update ring->next_to_clean
and smp_load_acquire to read ring->next_to_clean to properly
hand off buffers from hns3_clean_tx_ring to hns3_nic_net_xmit.
Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/cpufreq/cpufreq_ondemand.c')
0 files changed, 0 insertions, 0 deletions