net: axienet: Fix TX ring slot available check
authorRobert Hancock <robert.hancock@calian.com>
Tue, 18 Jan 2022 21:41:29 +0000 (15:41 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 09:54:32 +0000 (10:54 +0100)
commit6301f3566aef4e8e8ad6019e43ddb95ad6f65fc6
tree9ef312900b3ded32e7aa558175faa32c13b2f578
parent7a3d3d7f6d7b3db6cabeb9d43ef207c3eda1b8a5
net: axienet: Fix TX ring slot available check

commit 996defd7f8b5dafc1d480b7585c7c62437f80c3c upstream.

The check for whether a TX ring slot was available was incorrect,
since a slot which had been loaded with transmit data but the device had
not started transmitting would be treated as available, potentially
causing non-transmitted slots to be overwritten. The control field in
the descriptor should be checked, rather than the status field (which may
only be updated when the device completes the entry).

Fixes: 8a3b7a252dca9 ("drivers/net/ethernet/xilinx: added Xilinx AXI Ethernet driver")
Signed-off-by: Robert Hancock <robert.hancock@calian.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/xilinx/xilinx_axienet_main.c