diff options
author | Esben Haabendal <esben@geanix.com> | 2019-04-30 09:17:56 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-05-01 14:33:30 -0400 |
commit | 2c9938e738a273ba315679781a9990c7d3b1831b (patch) | |
tree | b7183204ab0089c1e0debdf53d3351345df5a0c7 | |
parent | a8c9bd3ba84084b6cca704d5b21ee0ba971b748b (diff) | |
download | linux-2c9938e738a273ba315679781a9990c7d3b1831b.tar.gz linux-2c9938e738a273ba315679781a9990c7d3b1831b.tar.bz2 linux-2c9938e738a273ba315679781a9990c7d3b1831b.zip |
net: ll_temac: Fix bug causing buffer descriptor overrun
As we are actually using a BD for both the skb and each frag contained in
it, the oldest TX BD would be overwritten when there was exactly one BD
less than needed.
Signed-off-by: Esben Haabendal <esben@geanix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/xilinx/ll_temac_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c index 7e42746f2292..68375655e61b 100644 --- a/drivers/net/ethernet/xilinx/ll_temac_main.c +++ b/drivers/net/ethernet/xilinx/ll_temac_main.c @@ -743,7 +743,7 @@ temac_start_xmit(struct sk_buff *skb, struct net_device *ndev) start_p = lp->tx_bd_p + sizeof(*lp->tx_bd_v) * lp->tx_bd_tail; cur_p = &lp->tx_bd_v[lp->tx_bd_tail]; - if (temac_check_tx_bd_space(lp, num_frag)) { + if (temac_check_tx_bd_space(lp, num_frag + 1)) { if (!netif_queue_stopped(ndev)) netif_stop_queue(ndev); return NETDEV_TX_BUSY; |