net: axienet: fix number of TX ring slots for available check
authorRobert Hancock <robert.hancock@calian.com>
Tue, 18 Jan 2022 21:41:30 +0000 (15:41 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 08:01:00 +0000 (09:01 +0100)
commit766aa5f2387494c9e48a3575029034d037a67f96
tree3f745fdfb1599b642cb0cf2f220bf171d89a8b09
parentff594e1b6f39f07f050759de2d27c36b7739c0c9
net: axienet: fix number of TX ring slots for available check

commit aba57a823d2985a2cc8c74a2535f3a88e68d9424 upstream.

The check for the number of available TX ring slots was off by 1 since a
slot is required for the skb header as well as each fragment. This could
result in overwriting a TX ring slot that was still in use.

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