r8169: use READ_ONCE in rtl_tx_slots_avail
authorHeiner Kallweit <hkallweit1@gmail.com>
Wed, 11 Nov 2020 21:14:27 +0000 (22:14 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 14 Nov 2020 00:28:59 +0000 (16:28 -0800)
commit95f3c5458dfa5856bb110e31d156e00d894d0134
tree4126f24ab3ab40099e6797b4c26f63fd5df44184
parent2caf08e757ef7a396cf496eecd7730dceec2dd35
r8169: use READ_ONCE in rtl_tx_slots_avail

tp->dirty_tx and tp->cur_tx may be changed by a racing rtl_tx() or
rtl8169_start_xmit(). Use READ_ONCE() to annotate the races and ensure
that the compiler doesn't use cached values.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/5676fee3-f6b4-84f2-eba5-c64949a371ad@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/realtek/r8169_main.c